From 6362b3d71af68516e2f9b403f4850ac532b4585d Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 6 Oct 2019 13:43:11 +0000 Subject: [PATCH] Designer: Fix a crash bug caused by r61974 #dcb8bd49fb. Top form has no Owner. git-svn-id: trunk@62001 - --- designer/designer.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/designer.pp b/designer/designer.pp index 0fe5d5fa9b..8c2e364b14 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -1878,8 +1878,9 @@ begin if aPersistent is TComponent then begin Comp := TComponent(aPersistent); compName := Comp.Name; - if Comp.Owner <> LookupRoot then // This is a subcomponent. - compName := Comp.Owner.Name + '.' + compName; // Add owner to the name. + // Add owner to the name of a subcomponent. + if Assigned(Comp.Owner) and (Comp.Owner <> LookupRoot) then + compName := Comp.Owner.Name + '.' + compName; if Comp.HasParent then parentName := Comp.GetParentComponent.Name; end;