USB: Don't crash and burn if there is no ini file for pcsx2.

This commit is contained in:
arcum42 authored and refractionpcsx2 committed 2022-12-18 09:00:25 +00:00
1 parent 8cf430ef7e
commit c46d316e95
1 file changed
+3
+3
View File
@@ -115,6 +115,9 @@ public:
DeviceProxy* Device(int index)
{
if (index < 0)
return nullptr; // Don't try to go backwards at the beginning of an iterator and crash and burn when pcsx2 is run for the first time.
auto it = registerDeviceMap.begin();
std::advance(it, index);
if (it != registerDeviceMap.end())