From 099ae2484feaa77a6a436d7cf4164491de9ebde0 Mon Sep 17 00:00:00 2001 From: goyuken Date: Thu, 6 Feb 2014 22:08:01 +0000 Subject: [PATCH] show slightly informative message if mainform tries to load saveram for a game that has none --- BizHawk.Client.EmuHawk/MainForm.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 955f2dc09e..6ef485a5b7 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1100,7 +1100,13 @@ namespace BizHawk.Client.EmuHawk } else { - sram = new byte[Global.Emulator.ReadSaveRam().Length]; + var oldram = Global.Emulator.ReadSaveRam(); + if (oldram == null) + { + MessageBox.Show("Error: tried to load saveram, but core would not accept it?"); + return; + } + sram = new byte[oldram.Length]; using (var reader = new BinaryReader( new FileStream(PathManager.SaveRamPath(Global.Game), FileMode.Open, FileAccess.Read))) {