diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2019-03-17 10:50:10 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2019-03-17 10:50:10 -0400 |
commit | 14b83db71c0fd4249f5753134a33e4e36f6a775f (patch) | |
tree | 1c01c4d818c741297b3cd7dae1d87857b1400ec8 | |
parent | 57c4c45dc343217c25b6fd0985516d35326363af (diff) | |
download | sdl_core-14b83db71c0fd4249f5753134a33e4e36f6a775f.tar.gz |
Add null check for app in HandleSubscribefeature/app_service_manager_tests
-rw-r--r-- | src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc index 7b29160692..7c2e62abe2 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc @@ -68,11 +68,10 @@ void GetAppServiceDataRequest::Run() { void GetAppServiceDataRequest::HandleSubscribe() { std::string service_type = (*message_)[strings::msg_params][strings::service_type].asString(); - if ((*message_)[strings::msg_params].keyExists(strings::subscribe)) { + ApplicationSharedPtr app = application_manager_.application(connection_key()); + if (app && (*message_)[strings::msg_params].keyExists(strings::subscribe)) { bool subscribe = (*message_)[strings::msg_params][strings::subscribe].asBool(); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); auto& ext = AppServiceAppExtension::ExtractASExtension(*app); if (subscribe) { ext.SubscribeToAppService(service_type); |