From 626125debf8c9f7032561df6fe670fcc6398e94c Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 1 Dec 2021 20:39:53 +0100 Subject: [PATCH] LazDebuggerFp: fixed a nil deref, DefaultContext needs CurrentThread (cherry picked from commit 217459a76f8128503578039e2c6ffc521aab4ec8) --- components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index 33af7e635b..d4d939984b 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -2422,10 +2422,11 @@ begin exit; end; end; - FDebugger.FDbgController.DefaultContext; // Make sure it is avail and cached / so it can be called outside the thread if CurrentThread = nil then exit; + + FDebugger.FDbgController.DefaultContext; // Make sure it is avail and cached / so it can be called outside the thread if (FState = esSteppingFpcSpecialHandler) and AnIsFinished and (ACurCommand is TDbgControllerStepThroughFpcSpecialHandler) then begin