don't crash when fail to save state due to IOException

This commit is contained in:
goyuken 2014-08-18 18:06:15 +00:00
parent a25c6b4665
commit e09e10d90c
1 changed files with 9 additions and 3 deletions

View File

@ -2415,10 +2415,16 @@ namespace BizHawk.Client.EmuHawk
public void SaveState(string path, string userFriendlyStateName, bool fromLua)
{
SavestateManager.SaveStateFile(path, userFriendlyStateName);
GlobalWin.OSD.AddMessage("Saved state: " + userFriendlyStateName);
try
{
SavestateManager.SaveStateFile(path, userFriendlyStateName);
GlobalWin.OSD.AddMessage("Saved state: " + userFriendlyStateName);
}
catch (IOException)
{
GlobalWin.OSD.AddMessage("Unable to save state " + path);
}
if (!fromLua)
{
UpdateStatusSlots();