From: jk.pu Date: Tue, 25 Oct 2016 11:07:07 +0000 (+0900) Subject: [iotcon] fix fail to retrieve platform info X-Git-Tag: submit/tizen/20161026.090018~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44bca676d0fb46bafe4789a27e37824e663d4c33;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [iotcon] fix fail to retrieve platform info if some device or platform value is null . it return error callback. fix to return empty string. Change-Id: I9eb890d752055a0e4e664b345bb8b237b3e06c24 Signed-off-by: jk.pu --- diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc index fce0426d..96240497 100644 --- a/src/iotcon/iotcon_utils.cc +++ b/src/iotcon/iotcon_utils.cc @@ -1783,11 +1783,13 @@ common::TizenResult IotconUtils::PlatformInfoGetProperty(iotcon_platform_info_h &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})); + + if (!property) { + out->insert(std::make_pair(name, picojson::value{""})); + }else{ + out->insert(std::make_pair(name, picojson::value{property})); + } return TizenSuccess(); } @@ -1907,10 +1909,15 @@ common::TizenResult IotconUtils::DeviceInfoGetProperty(iotcon_device_info_h devi auto result = ConvertIotconError(iotcon_device_info_get_property(device, property_e, &property)); - if (!result || !property) { + if (!result ) { LogAndReturnTizenError(result, ("iotcon_device_info_get_property() failed")); } - out->insert(std::make_pair(name, picojson::value{property})); + + if (!property) { + out->insert(std::make_pair(name, picojson::value{""})); + }else{ + out->insert(std::make_pair(name, picojson::value{property})); + } return TizenSuccess(); }