From e0740f7526117dac670c82f626f5b6a1db747673 Mon Sep 17 00:00:00 2001 From: collin Date: Tue, 19 May 2020 12:14:09 -0400 Subject: initialize app in non custom button path of on_button_press run --- .../src/commands/mobile/on_button_press_notification.cc | 7 ++++--- 1 file 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(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)) { -- cgit v1.2.1