diff options
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index c51991742d..a205660e23 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -67,6 +67,10 @@ void OnButtonPressNotification::Run() { const bool is_app_id_exists = (*message_)[strings::msg_params].keyExists(strings::app_id); ApplicationSharedPtr app; + if (is_app_id_exists) { + app = application_manager_.application( + (*message_)[strings::msg_params][strings::app_id].asUInt()); + } // CUSTOM_BUTTON notification if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { @@ -76,9 +80,6 @@ void OnButtonPressNotification::Run() { return; } - app = application_manager_.application( - (*message_)[strings::msg_params][strings::app_id].asUInt()); - // custom_button_id is mandatory for CUSTOM_BUTTON notification if (false == (*message_)[strings::msg_params].keyExists( hmi_response::custom_button_id)) { |