From 43826bad9bb87f430def31ef5ce37740dbd4df38 Mon Sep 17 00:00:00 2001 From: Juha Date: Sat, 8 Mar 2025 00:29:16 +0200 Subject: [PATCH] LCL: One more sanity check for a new Notebook page name. Issue #36957. --- lcl/include/notebook.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcl/include/notebook.inc b/lcl/include/notebook.inc index 281f98dde7..10dc721116 100644 --- a/lcl/include/notebook.inc +++ b/lcl/include/notebook.inc @@ -17,8 +17,9 @@ function CreateUniquePageName(BaseName: string; OwnerComp: TComponent): string; var i, j: integer; begin - i:=0; Result:=BaseName; + if (OwnerComp=nil) or (Result='') then exit; + i:=0; while true do begin j:=OwnerComp.ComponentCount-1; while (j>=0) and (CompareText(Result,OwnerComp.Components[j].Name)<>0) do