diff options
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 721c996aca8..e6becc6f6be 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5541,7 +5541,10 @@ static PyObject *pyrna_basetype_register(PyObject *UNUSED(self), PyObject *py_cl if(BPy_reports_to_error(&reports, TRUE)) return NULL; - BKE_assert(srna_new != NULL); + /* python errors validating are not converted into reports so the check above will fail. + * the cause for returning NULL will be printed as an error */ + if(srna_new == NULL) + return NULL; pyrna_subtype_set_rna(py_class, srna_new); /* takes a ref to py_class */ |