From 8214a649c37e99c85e9b15e659e0b1736b2196fb Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Wed, 25 Jul 2012 13:55:25 +0000 Subject: [PATCH] Lua console - fix to autoload lua session, if there is no recent session, it will open nothing, rather than cause an exception --- BizHawk.MultiClient/tools/LuaConsole.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BizHawk.MultiClient/tools/LuaConsole.cs b/BizHawk.MultiClient/tools/LuaConsole.cs index 68f8673dd9..43345cd792 100644 --- a/BizHawk.MultiClient/tools/LuaConsole.cs +++ b/BizHawk.MultiClient/tools/LuaConsole.cs @@ -94,7 +94,12 @@ namespace BizHawk.MultiClient { LoadConfigSettings(); 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) @@ -390,7 +395,7 @@ namespace BizHawk.MultiClient luaList.Clear(); DisplayLuaList(); UpdateNumberOfScripts(); - currentSessionFile = ""; + currentSessionFile = ""; Changes(false); } }