ResourcePresenceUnitTest: Fix when the requesterList is not initialized
authorRavi Nanjundappa <nravi.n@samsung.com>
Tue, 21 Jul 2015 09:00:33 +0000 (14:30 +0530)
committerUze Choi <uzchoi@samsung.com>
Wed, 22 Jul 2015 08:12:49 +0000 (08:12 +0000)
This issue fixes the segmentation fault issue during the execution of broker_test.
The fix returns true when the requesterList itself is not initialized, otherwise
returns the value of requesterList->empty().

Change-Id: I3e57264497fd283e15824b088c6dcad925e0c2f4
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1780
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-manipulation/src/resourceBroker/src/ResourcePresence.cpp

index e20e5db..f9eb8de 100755 (executable)
@@ -125,7 +125,7 @@ namespace OIC
 
         bool ResourcePresence::isEmptyRequester() const
         {
-            return requesterList->empty();
+            return (requesterList!=nullptr)?requesterList->empty():true;
         }
 
         int ResourcePresence::requesterListSize() const {