1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

input: add missing nullptr checks for pad

This commit is contained in:
Megamouse 2022-01-27 21:06:37 +01:00
parent 7977fbb9c5
commit 8efc29972d
2 changed files with 6 additions and 1 deletions

View File

@ -431,6 +431,11 @@ void PadHandlerBase::TranslateButtonPress(const std::shared_ptr<PadDevice>& devi
bool PadHandlerBase::bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device, u8 player_id)
{
if (!pad)
{
return false;
}
std::shared_ptr<PadDevice> pad_device = get_device(device);
if (!pad_device)
{

View File

@ -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> 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());