Designer: Fix a crash bug caused by r61974 #dcb8bd49fb. Top form has no Owner.

git-svn-id: trunk@62001 -
This commit is contained in:
juha 2019-10-06 13:43:11 +00:00
parent 0507fec465
commit 6362b3d71a

View File

@ -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;