diff --git a/components/lazdebuggers/lazdebuggerfpgdbmi/fpgdbmidebugger.pp b/components/lazdebuggers/lazdebuggerfpgdbmi/fpgdbmidebugger.pp index 92a2e17fe0..d3009a277d 100644 --- a/components/lazdebuggers/lazdebuggerfpgdbmi/fpgdbmidebugger.pp +++ b/components/lazdebuggers/lazdebuggerfpgdbmi/fpgdbmidebugger.pp @@ -885,7 +885,7 @@ begin end; s := CallStack.CurrentCallStackList.EntriesForThreads[AThreadId]; - if s = nil then begin + if (s = nil) or (AStackFrame >= s.Count) then begin DebugLn(DBG_ERRORS, ['NO Stackframe list for thread']); exit; end;