Lua console - fix to autoload lua session, if there is no recent session, it will open nothing, rather than cause an exception

This commit is contained in:
andres.delikat 2012-07-25 13:55:25 +00:00
parent 1bedd81666
commit 8214a649c3
1 changed files with 7 additions and 2 deletions

View File

@ -94,7 +94,12 @@ namespace BizHawk.MultiClient
{ {
LoadConfigSettings(); LoadConfigSettings();
if (Global.Config.AutoLoadLuaSession) if (Global.Config.AutoLoadLuaSession)
LoadSessionFromRecent(Global.Config.RecentLuaSession.GetRecentFileByPosition(0)); {
if (!Global.Config.RecentLuaSession.IsEmpty())
{
LoadSessionFromRecent(Global.Config.RecentLuaSession.GetRecentFileByPosition(0));
}
}
} }
private void StopScript(int x) private void StopScript(int x)
@ -390,7 +395,7 @@ namespace BizHawk.MultiClient
luaList.Clear(); luaList.Clear();
DisplayLuaList(); DisplayLuaList();
UpdateNumberOfScripts(); UpdateNumberOfScripts();
currentSessionFile = ""; currentSessionFile = "";
Changes(false); Changes(false);
} }
} }