Add condition for topic of sendNotification.
authorjaesick.shin <jaesick.shin@samsung.com>
Wed, 7 Sep 2016 00:32:52 +0000 (09:32 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 8 Sep 2016 06:50:28 +0000 (06:50 +0000)
topic case is Null or '\0'.

Change-Id: I216fd165145bd7523810e8636919c95f89470ef0
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11465
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Abitha Shankar <abitha.s@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/src/provider/NSProviderNotification.c

index 13ebdfd..e08365f 100644 (file)
@@ -114,7 +114,7 @@ NSResult NSSendNotification(NSMessage *msg)
         {
             if(subData->messageObId != 0)
             {
-                if(msg->topic)
+                if(msg->topic && (msg->topic)[0] != '\0')
                 {
                     NS_LOG_V(DEBUG, "this is topic message: %s", msg->topic);
 
@@ -132,7 +132,7 @@ NSResult NSSendNotification(NSMessage *msg)
 #if(defined WITH_CLOUD && defined RD_CLIENT)
             if(subData->remote_messageObId != 0)
             {
-                if(msg->topic)
+                if(msg->topic && (msg->topic)[0] != '\0')
                 {
                     NS_LOG_V(DEBUG, "this is topic message via remote server: %s", msg->topic);
                     if(NSProviderIsTopicSubScribed(consumerTopicList->head, subData->id, msg->topic))