Skip to content

Commit

Permalink
Debugger: Script window - Prevent crash when attempting to load the p…
Browse files Browse the repository at this point in the history
…revious script when no script was ever loaded before
  • Loading branch information
SourMesen committed Sep 7, 2024
1 parent 816e77e commit 008149c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UI/Debugger/ViewModels/ScriptWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public ScriptWindowViewModel(ScriptStartupBehavior? behavior = null)
switch(behavior ?? Config.ScriptStartupBehavior) {
case ScriptStartupBehavior.ShowBlankWindow: break;
case ScriptStartupBehavior.ShowTutorial: LoadScriptFromResource("Mesen.Debugger.Utilities.LuaScripts.Example.lua"); break;
case ScriptStartupBehavior.LoadLastScript: LoadScript(Config.RecentScripts[0]); break;
case ScriptStartupBehavior.LoadLastScript:
if(Config.RecentScripts.Count > 0) {
LoadScript(Config.RecentScripts[0]);
}
break;
}
}

Expand Down

0 comments on commit 008149c

Please sign in to comment.