Fix segfault on Outliner.
authorDiego Borghetti <bdiego@gmail.com>
Wed, 20 May 2009 15:59:57 +0000 (15:59 +0000)
committerDiego Borghetti <bdiego@gmail.com>
Wed, 20 May 2009 15:59:57 +0000 (15:59 +0000)
Try to expand the RNA tree in Outliner -> User Preference crash blender.

RNA_struct_idproperties was not checking if ptr.data is NULL
and always try to access the properties type information.

Note: brecht double check this.

source/blender/makesrna/intern/rna_access.c

index 36d1089ad7f5c7717bbde070eacfbd3b0e616699..5f513bfec708a920345ebe77dd607b21fc7252d0 100644 (file)
@@ -146,11 +146,13 @@ PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *da
 
 IDProperty *RNA_struct_idproperties(PointerRNA *ptr, int create)
 {
-       StructRNA *type= ptr->type;
+       StructRNA *type;
 
-       if(type->idproperties)
-               return type->idproperties(ptr, create);
-       
+       if (ptr->data) {
+               type= ptr->type;
+               if(type->idproperties)
+                       return type->idproperties(ptr, create);
+       }
        return NULL;
 }