From 38d47de87b8835e5e52ffb76071d774b859a95a2 Mon Sep 17 00:00:00 2001 From: Maxim Ganetsky Date: Sun, 25 May 2025 22:46:48 +0300 Subject: [PATCH] LCL: Do not try to access a method of nil AControl in class procedure TDockHeader.PerformMouseDown, fixes crashes in some cases. Issue #41675, hint by Hans vB. --- lcl/ldocktree.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lcl/ldocktree.pas b/lcl/ldocktree.pas index 86be66cc0d..5e9b6a1943 100644 --- a/lcl/ldocktree.pas +++ b/lcl/ldocktree.pas @@ -504,6 +504,8 @@ end; class procedure TDockHeader.PerformMouseDown(AControl: TControl; APart: TLazDockHeaderPart); begin + if AControl=nil then + exit; case APart of ldhpAll, ldhpCaption: // mouse down on not buttons => start drag