From a95ac46c9dc93f3ed472279f9a628d662d842cb2 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 18 Jan 2025 10:42:00 +0000 Subject: [PATCH] CalLite: Avoid crash when Colors are shared (Issue #39097) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9592 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/callite/source/calendarlite.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/callite/source/calendarlite.pas b/components/callite/source/calendarlite.pas index dc8713db4..40ee8fc41 100644 --- a/components/callite/source/calendarlite.pas +++ b/components/callite/source/calendarlite.pas @@ -1463,7 +1463,9 @@ procedure TCalColors.SetColor(AIndex: Integer; AValue: TColor); begin if FColors[AIndex] = AValue then exit; FColors[AIndex] := AValue; - FOwner.Draw; + // FOwner can be nil, if Colors are shared (Issue #39097) + if FOwner <> nil then + FOwner.Draw; end;