Don't crash if user elected to autoload Ram Watch but not autoload a Rom

This commit is contained in:
adelikat 2015-02-25 22:32:50 +00:00
parent 81a8d38ca4
commit f305ca5666
1 changed files with 9 additions and 6 deletions

View File

@ -736,14 +736,17 @@ namespace BizHawk.Client.EmuHawk
{
Load<RamWatch>();
if (Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty)
if (IsAvailable<RamWatch>()) // Just because we attempted to load it, doesn't mean it was, the current core may not have the correct dependencies
{
RamWatch.LoadFileFromRecent(Global.Config.RecentWatches.MostRecent);
}
if (Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty)
{
RamWatch.LoadFileFromRecent(Global.Config.RecentWatches.MostRecent);
}
if (!loadDialog)
{
Get<RamWatch>().Close();
if (!loadDialog)
{
Get<RamWatch>().Close();
}
}
}