LCL: Extra check for Nil in GetParentForm.

git-svn-id: trunk@48605 -
This commit is contained in:
juha 2015-04-03 07:29:04 +00:00
parent 0acacf6e19
commit 0d06d0a109

View File

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