Browse Source

* Fixed Issue ID38920: twriter crashes on readonly nil component

git-svn-id: trunk@49389 -
michael 4 years ago
parent
commit
61cd38e6db
1 changed files with 3 additions and 2 deletions
  1. 3 2
      rtl/objpas/classes/writer.inc

+ 3 - 2
rtl/objpas/classes/writer.inc

@@ -892,8 +892,9 @@ begin
     if PropType^.Kind<>tkClass then
       exit;
     ObjValue := TObject(GetObjectProp(Instance, PropInfo));
-    if not ObjValue.InheritsFrom(TComponent) or
-       not (csSubComponent in TComponent(ObjValue).ComponentStyle) then
+    if not (assigned(ObjValue) and
+            ObjValue.InheritsFrom(TComponent) and
+            (csSubComponent in TComponent(ObjValue).ComponentStyle)) then
       exit;
   end;