1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

Qt: fix access to uninitialized Pad object

Fixes a crash when opening the pad settings before the pad handlers are initialized.
This commit is contained in:
Megamouse 2022-04-21 23:43:39 +02:00
parent f42e647430
commit 6a67155404

View File

@ -1694,7 +1694,12 @@ bool pad_settings_dialog::GetIsLddPad(u32 index) const
std::lock_guard lock(pad::g_pad_mutex);
if (const auto handler = pad::get_current_handler(true))
{
return handler->GetPads().at(index)->ldd;
ensure(index < handler->GetPads().size());
if (const std::shared_ptr<Pad> pad = handler->GetPads().at(index))
{
return pad->ldd;
}
}
}