summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-09-26 09:40:09 -0400
committerGitHub <noreply@github.com>2017-09-26 09:40:09 -0400
commit95091a77d56828e27710e38ba2af39b00386d183 (patch)
treed674d6d41fc4bd98e9264f9e3e11dc92788f69f7
parentc38e85f34ae5ebad13bc5a6b3d87abb474583e90 (diff)
parentb175a338cf070057ba0b62a57845b3d01ca51712 (diff)
downloadsdl_core-95091a77d56828e27710e38ba2af39b00386d183.tar.gz
Merge pull request #1774 from AKalinich-Luxoft/hotfix/fix_cache_manager_hmi_types_getter
Fix DISALLOWED response when app has specifically defined policies
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc5
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index 22040c88b2..95b2fda272 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -340,7 +340,10 @@ const policy_table::AppHMITypes* CacheManager::GetHMITypes(
pt_->policy_table.app_policies_section.apps;
policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
if (i != apps.end()) {
- return &(*i->second.AppHMIType);
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
}
return NULL;
}
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 78674c81f3..b395e4e04c 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -133,7 +133,10 @@ const policy_table::AppHMITypes* CacheManager::GetHMITypes(
pt_->policy_table.app_policies_section.apps;
policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
if (i != apps.end()) {
- return &(*i->second.AppHMIType);
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
}
return NULL;
}