[Application] - Fixing undefined iconPath attribute issue 23/79123/2
authorAndrzej Popowski <a.popowski@samsung.com>
Fri, 8 Jul 2016 08:28:45 +0000 (17:28 +0900)
committerAndrzej Popowski <a.popowski@samsung.com>
Fri, 8 Jul 2016 08:48:55 +0000 (01:48 -0700)
TCT result: 99.47% (190/189/0/1/0)

Change-Id: I79471656580973c1d22964e4c5caaed7270cf5af
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/application/application_utils.cc

index 9cf23d5..1c39776 100644 (file)
@@ -39,6 +39,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h
   ret = pkgmgrinfo_appinfo_get_appid(handle, &tmp_str);
   if ((PMINFO_R_OK != ret) || (nullptr == tmp_str)) {
     LoggerE("Failed to get appid: %d (%s)", ret, get_error_message(ret));
+    app_info->insert(std::make_pair("id", picojson::value("")));
   } else {
     app_info->insert(std::make_pair("id", picojson::value(tmp_str)));
   }
@@ -57,6 +58,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h
   ret = pkgmgrinfo_appinfo_get_icon(handle, &tmp_str);
   if ((PMINFO_R_OK != ret) || (nullptr == tmp_str)) {
     LoggerE("Failed to get icon path: %d (%s)", ret, get_error_message(ret));
+    app_info->insert(std::make_pair("iconPath", picojson::value("")));
   } else {
     app_info->insert(std::make_pair("iconPath", picojson::value(tmp_str)));
   }
@@ -67,6 +69,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h
   ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &no_display);
   if (PMINFO_R_OK != ret) {
     LoggerE("Failed to get nodisplay: %d (%s)", ret, get_error_message(ret));
+    app_info->insert(std::make_pair("show", picojson::value(false)));
   } else {
     app_info->insert(std::make_pair("show", picojson::value(!no_display)));
   }