summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 07324d5bc..42d855a81 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -1681,9 +1681,14 @@ void MessageHelper::GetDeviceInfoForApp(uint32_t connection_key,
return;
}
- device_info->device_handle =
- ApplicationManagerImpl::instance()->application(connection_key)->device();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ connection_key);
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application with connection_key " << connection_key);
+ return;
+ }
+ device_info->device_handle = app->device();
GetDeviceInfoForHandle(device_info->device_handle, device_info);
}