mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
LCL: Extra check for Nil in GetParentForm.
git-svn-id: trunk@48605 -
This commit is contained in:
parent
0acacf6e19
commit
0d06d0a109
@ -1917,7 +1917,7 @@ end;
|
||||
function GetParentForm(Control: TControl; TopForm: Boolean): TCustomForm;
|
||||
begin
|
||||
//For Delphi compatibility if Control is a TCustomForm with no parent, the function returns the TCustomForm itself
|
||||
while Control.Parent <> nil do
|
||||
while (Control <> nil) and (Control.Parent <> nil) do
|
||||
begin
|
||||
if (not TopForm) and (Control is TCustomForm) then
|
||||
Break;
|
||||
|
Loading…
Reference in New Issue
Block a user