catch exceptions in savestate load

see also #2090. This can reasonably catch and handle simple load failures like all waterbox loads and some others.

Not calling the issue fixed because there is more that can be done to prevent cores from trying to load invalid savestates.
This commit is contained in:
Morilli 2025-03-07 22:23:43 +01:00
parent b0b32bea6a
commit 1c0e72b169
1 changed files with 8 additions and 1 deletions

View File

@ -147,7 +147,14 @@ namespace BizHawk.Client.Common
using (new SimpleTime("Load Core"))
{
bl.GetCoreState(br => _statable.LoadStateBinary(br), tr => _statable.LoadStateText(tr));
try
{
bl.GetCoreState(br => _statable.LoadStateBinary(br), tr => _statable.LoadStateText(tr));
}
catch (Exception)
{
return false;
}
}
// We must handle movie input AFTER the core is loaded to properly handle mode changes, and input latching