summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym <mked@luxoft.com>2020-02-25 18:48:27 +0200
committerAndriy Byzhynar <abyzhynar@luxoft.com>2020-02-26 16:04:48 +0200
commitc8a50bab68b1c61d9dcfadbf92b1791e06080838 (patch)
tree805854dfb47c2cf1a47bcbaebfc20e8f42674ca8
parentfb2f465302dd4ed7323e8142f67b3ed1e219c2be (diff)
downloadsdl_core-feature/web_engine_support_with_GAP_fix.tar.gz
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc
index 57e4318c8a..0dafa21e33 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc
@@ -102,13 +102,14 @@ void BCGetAppPropertiesRequest::Run() {
const auto& msg_params = (*message_)[strings::msg_params];
smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- smart_objects::SmartObject properties(smart_objects::SmartType_Map);
if (msg_params.keyExists(strings::policy_app_id)) {
const auto policy_app_id = msg_params[strings::policy_app_id].asString();
+ smart_objects::SmartObject properties(smart_objects::SmartType_Map);
FillAppProperties(policy_app_id, properties);
- response_params[strings::properties][0] = properties;
-
+ if (!properties.empty()) {
+ response_params[strings::properties][0] = properties;
+ }
} else {
LOG4CXX_DEBUG(logger_,
"policyAppID was absent in request, all apps properties "
@@ -116,12 +117,13 @@ void BCGetAppPropertiesRequest::Run() {
const auto app_ids = policy_handler_.GetApplicationPolicyIDs();
int i = 0;
for (auto& app_id : app_ids) {
+ smart_objects::SmartObject properties(smart_objects::SmartType_Map);
FillAppProperties(app_id, properties);
response_params[strings::properties][i++] = properties;
}
}
- if (properties.empty()) {
+ if (response_params[strings::properties].empty()) {
SendErrorResponse(
(*message_)[strings::params][strings::correlation_id].asUInt(),
hmi_apis::FunctionID::BasicCommunication_GetAppProperties,