Fix `FileNotFoundException` thrown from quickslot preview

fixes 1db54108a
This commit is contained in:
James Groom 2024-04-06 03:41:12 +10:00 committed by GitHub
parent 1db54108ac
commit 7d951c6a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -4248,9 +4248,11 @@ namespace BizHawk.Client.EmuHawk
}
public BitmapBuffer/*?*/ ReadScreenshotFromSavestate(int slot)
=> Emulator.HasSavestates()
? SavestateFile.GetFrameBufferFrom($"{SaveStatePrefix()}.QuickSave{slot % 10}.State")
: null;
{
if (!Emulator.HasSavestates()) return false;
var path = $"{SaveStatePrefix()}.QuickSave{slot % 10}.State";
return File.Exists(path) ? SavestateFile.GetFrameBufferFrom(path) : null;
}
public bool LoadState(string path, string userFriendlyStateName, bool suppressOSD = false) // Move to client.common
{