Просмотр исходного кода

* Check component is not nil prior to calling validateinsert

Michaël Van Canneyt 1 год назад
Родитель
Сommit
f1c4f0c879
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      rtl/objpas/classes/compon.inc

+ 2 - 1
rtl/objpas/classes/compon.inc

@@ -482,7 +482,8 @@ end;
 Procedure TComponent.ValidateContainer(AComponent: TComponent);
 Procedure TComponent.ValidateContainer(AComponent: TComponent);
 
 
 begin
 begin
-  AComponent.ValidateInsert(Self);
+  if Assigned(aComponent) then
+    AComponent.ValidateInsert(Self);
 end;
 end;