summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}