mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12: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
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue