mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-01 12:15:27 -06: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:
parent
f42e647430
commit
6a67155404
@ -1694,7 +1694,12 @@ bool pad_settings_dialog::GetIsLddPad(u32 index) const
|
|||||||
std::lock_guard lock(pad::g_pad_mutex);
|
std::lock_guard lock(pad::g_pad_mutex);
|
||||||
if (const auto handler = pad::get_current_handler(true))
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user