diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index 95e00a1d0a..2d6e7cb212 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -431,6 +431,11 @@ void PadHandlerBase::TranslateButtonPress(const std::shared_ptr& devi bool PadHandlerBase::bindPadToDevice(std::shared_ptr pad, const std::string& device, u8 player_id) { + if (!pad) + { + return false; + } + std::shared_ptr pad_device = get_device(device); if (!pad_device) { diff --git a/rpcs3/Input/keyboard_pad_handler.cpp b/rpcs3/Input/keyboard_pad_handler.cpp index a8f323b3de..72982c23ff 100644 --- a/rpcs3/Input/keyboard_pad_handler.cpp +++ b/rpcs3/Input/keyboard_pad_handler.cpp @@ -750,7 +750,7 @@ std::string keyboard_pad_handler::native_scan_code_to_string(int native_scan_cod bool keyboard_pad_handler::bindPadToDevice(std::shared_ptr pad, const std::string& device, u8 player_id) { - if (device != pad::keyboard_device_name) + if (!pad || device != pad::keyboard_device_name) return false; m_pad_configs[player_id].from_string(g_cfg_input.player[player_id]->config.to_string());