From f35cef97b00a2354d45b0e1969f0a648ad1bed10 Mon Sep 17 00:00:00 2001 From: Sour Date: Tue, 6 Mar 2018 19:45:39 -0500 Subject: [PATCH] Debugger: Fixed UI crash when stack pointer is $FF --- GUI.NET/Debugger/Controls/ctrlConsoleStatus.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GUI.NET/Debugger/Controls/ctrlConsoleStatus.cs b/GUI.NET/Debugger/Controls/ctrlConsoleStatus.cs index e5977bfd..4b60e48b 100644 --- a/GUI.NET/Debugger/Controls/ctrlConsoleStatus.cs +++ b/GUI.NET/Debugger/Controls/ctrlConsoleStatus.cs @@ -114,7 +114,9 @@ namespace Mesen.GUI.Debugger sb.Append(", "); } string stack = sb.ToString(); - stack = stack.Substring(0, stack.Length - 2); + if(stack.Length > 2) { + stack = stack.Substring(0, stack.Length - 2); + } txtStack.Text = stack; }