diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-03 21:15:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-03 21:15:15 +0300 |
commit | 6b82aa8d015adae51c3d83fc881f21e8cda95c5d (patch) | |
tree | f0f4d7a12f9dd16971958b5e4185d6e161eff39a | |
parent | 9297cb01f69f5b67beceb469f92d056f636e7113 (diff) |
fix for crash when some classes didnt register properly (this included loading sintel.blend).
-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 */ |