fix own error - missing NULL check [#26523] Crash when load factory settings ( linked...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Mar 2011 22:25:31 +0000 (22:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Mar 2011 22:25:31 +0000 (22:25 +0000)
source/blender/python/intern/bpy_rna.c

index 36e636dc11d5f445882dce10f8f7224e361620da..81ab52ca54a2689de4fe0cc6209a08243a2d35ff 100644 (file)
@@ -2967,7 +2967,7 @@ static PyObject *pyrna_struct_meta_idprop_getattro(PyObject *cls, PyObject *attr
 static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyObject *value)
 {
        StructRNA *srna= srna_from_self(cls, "StructRNA.__setattr__");
-       const int is_deferred_prop= pyrna_is_deferred_prop(value);
+       const int is_deferred_prop= (value && pyrna_is_deferred_prop(value));
 
        if(srna && !pyrna_write_check() && (is_deferred_prop || RNA_struct_type_find_property(srna, _PyUnicode_AsString(attr)))) {
                PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() can't set in readonly state '%.200s.%S'", ((PyTypeObject *)cls)->tp_name, attr);