fix own error - missing NULL check [#26523] Crash when load factory settings ( linked to rigify add-on ? )

This commit is contained in:
Campbell Barton 2011-03-16 22:25:31 +00:00
parent dc5a78ac25
commit 3ac925b7d1

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