Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2021-05-13 15:09:04 +09:00
parent dcde0bf4ff
commit fa7daac109
2 changed files with 15 additions and 2 deletions

View File

@@ -127,8 +127,15 @@ void MQTTGWPublishHandler::handlePublish(Client* client, MQTTGWPacket* packet)
/* add the Topic and get a TopicId */
topic = client->getTopics()->add(&topicId);
id = topic->getTopicId();
if (topic == nullptr)
{
WRITELOG("%sMQTTGWPublishHandler Can't Add a Topic. MAX_TOPIC_PAR_CLIENT is exceeded.%s\n",
ERRMSG_HEADER, ERRMSG_FOOTER);
delete snPacket;
return;
}
id = topic->getTopicId();
if (id > 0)
{
/* create REGISTER */