mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-24 19:52:37 +01:00
input: add missing nullptr checks for pad
This commit is contained in:
parent
7977fbb9c5
commit
8efc29972d
@ -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)
|
||||
{
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user