diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc index b9ee1339bb..66d50f4871 100644 --- a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc @@ -54,7 +54,7 @@ OnHashChangeNotification::~OnHashChangeNotification() { } void OnHashChangeNotification::Run() { - LOG4CXX_INFO(logger_, "OnHashChangeNotification::Run"); + LOG4CXX_AUTO_TRACE(logger_); (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); @@ -62,10 +62,15 @@ void OnHashChangeNotification::Run() { int32_t app_id; app_id = (*message_)[strings::params][strings::connection_key].asInt(); ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id); - std::stringstream stream; - stream << app->curHash(); - (*message_)[strings::msg_params][strings::hash_id] = stream.str(); - SendNotification(); + if (app) { + std::stringstream stream; + stream << app->curHash(); + (*message_)[strings::msg_params][strings::hash_id] = stream.str(); + SendNotification(); + } else { + LOG4CXX_WARN(logger_, "Application with app_id " << app_id << " does not exist"); + } + } } //namespace mobile |