[Iotcon] fixed additional throwing error on getProperty 38/82138/1
authorPiotr Kosko <p.kosko@samsung.com>
Mon, 1 Aug 2016 05:44:17 +0000 (07:44 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Mon, 1 Aug 2016 05:44:17 +0000 (07:44 +0200)
Change-Id: I77fea66d35875cd3d370a33db24b2ecb2223de5e
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
src/iotcon/iotcon_utils.cc

index 4edc261b312fcf57710c18d4b0584e01ad8bf27d..c1674186f9a3a9a72fa3f2852888b56e7ef29c13 100644 (file)
@@ -1767,8 +1767,11 @@ common::TizenResult IotconUtils::PlatformInfoGetProperty(iotcon_platform_info_h
   auto result = ConvertIotconError(iotcon_platform_info_get_property(platform,
                                                                      property_e,
                                                                      &property));
-  if (!result || !property) {
+  if (!result) {
     LogAndReturnTizenError(result, ("iotcon_platform_info_get_property() failed"));
+  } else if (!property) {
+    // TODO check if it should be an error or rather it should be ignored and used some default value
+    LogAndReturnTizenError(common::AbortError("iotcon_platform_info_get_property() returned no result"));
   }
   out->insert(std::make_pair(name, picojson::value{property}));