From: Piotr Kosko
Date: Mon, 1 Aug 2016 05:44:17 +0000 (+0200)
Subject: [Iotcon] fixed additional throwing error on getProperty
X-Git-Tag: submit/tizen/20160808.053811~5^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F82138%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Iotcon] fixed additional throwing error on getProperty
Change-Id: I77fea66d35875cd3d370a33db24b2ecb2223de5e
Signed-off-by: Piotr Kosko
---
diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc
index 4edc261b..c1674186 100644
--- a/src/iotcon/iotcon_utils.cc
+++ b/src/iotcon/iotcon_utils.cc
@@ -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}));