Fixed bug for execution of scene with empty scene member.
authorjyong2.kim <jyong2.kim@samsung.com>
Mon, 29 Feb 2016 00:57:40 +0000 (09:57 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 29 Feb 2016 06:57:53 +0000 (06:57 +0000)
When the execution of scene with empty scene member,
Execute callback was not call to app.
In this patch, Error handle is added for execution of scene with empty scene member.

Change-Id: I001a3183d79ea3c54822eebb28967b7c47c80637
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5247
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
service/scene-manager/src/SceneCollectionResource.cpp

index bb3d248..6139238 100644 (file)
@@ -152,7 +152,7 @@ namespace OIC
 
             auto foundSceneValue
                 = std::find(sceneValues.begin(), sceneValues.end(), sceneName);
-            if (foundSceneValue == sceneValues.end() && executeCB)
+            if (foundSceneValue == sceneValues.end() && executeCB && !m_sceneMembers.size())
             {
                 std::thread(executeCB, SCENE_CLIENT_BADREQUEST).detach();
                 return;