[SystemSetting] Added nullptr check.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 10 Jun 2015 09:50:59 +0000 (11:50 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 10 Jun 2015 09:50:59 +0000 (11:50 +0200)
Prevent CID: 404472

[Verification] Pass rate should not change.

Change-Id: I9ffa21ae7cd50215dc105849ffa2183ad333d349
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/systemsetting/systemsetting_instance.cc

index 6c760ebcdb7a6e088c895e778b251bdb6316c45e..c7ca9e066bf15c62823249f1d42e3e6179849c39 100644 (file)
@@ -118,7 +118,7 @@ PlatformResult SystemSettingInstance::getPlatformPropertyValue(
   switch (ret) {
     case SYSTEM_SETTINGS_ERROR_NONE:
       LoggerD("ret == SYSTEM_SETTINGS_ERROR_NONE");
-      result_obj.insert(std::make_pair("value", picojson::value(value)));
+      result_obj.insert(std::make_pair("value", picojson::value(value ? value : "")));
       free(value);
       return PlatformResult(ErrorCode::NO_ERROR);
     case SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API: