Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-26 15:44:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-26 15:44:09 +0300
commitdc30caab61755ba01f3330ff9513427a4c421c4f (patch)
tree0d7fd3f863a3c08a4feebba55d4ac1493de96a4d /source/blender/python
parentefa9d4f7e0921759500e4809a8eb72a4c14b20d5 (diff)
fix for crash when assigning unsupported type to collection properties.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_props.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 38d3c9161db..80aeaedf940 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -692,13 +692,17 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
{
StructRNA *srna;
- srna= srna_from_self(value, "BoolProperty(...):");
+ srna= srna_from_self(value, "");
if(!srna) {
-
- PyObject *msg= PyC_ExceptionBuffer();
- char *msg_char= _PyUnicode_AsString(msg);
- PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from IDPropertyGroup, failed with: %s", error_prefix, msg_char);
- Py_DECREF(msg);
+ if(PyErr_Occurred()) {
+ PyObject *msg= PyC_ExceptionBuffer();
+ char *msg_char= _PyUnicode_AsString(msg);
+ PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from IDPropertyGroup, failed with: %s", error_prefix, msg_char);
+ Py_DECREF(msg);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from IDPropertyGroup, failed with type '%s'", error_prefix, Py_TYPE(value)->tp_name);
+ }
return NULL;
}