diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-11-06 16:44:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-11-06 16:44:26 +0300 |
commit | 6142ae3785dc62ccb187a345e02981494e7085bf (patch) | |
tree | b5fd765da833d66f9bdd26067e1fc1b85d311bc4 /source/blender/python/api2_2x | |
parent | 9cd76a66096491e8994090e1992bb54d19c61950 (diff) |
==Python API==
Bugfix, Space Handlers could crash blender when used with armatures.
also fixed some possible bugs in other areas.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index 47ee2564698..6c22e831bd4 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -1202,6 +1202,10 @@ static PyObject *M_Armature_Get(PyObject * self, PyObject * args) data = G.main->armature.first; //get the first data ID from the armature library while (data){ py_armature = Armature_CreatePyObject(data); //*new* + if (!py_armature) { + EXPP_decr2(seq, dict); + return NULL; /* error is set from Armature_CreatePyObject */ + } sprintf(buffer, "%s", ((bArmature*)data)->id.name +2); if(PyDict_SetItemString(dict, buffer, py_armature) == -1){ //add to dictionary EXPP_decr3(seq, dict, py_armature); @@ -1219,6 +1223,11 @@ static PyObject *M_Armature_Get(PyObject * self, PyObject * args) data = find_id("AR", name); //get data from library if (data != NULL){ py_armature = Armature_CreatePyObject(data); //*new* + if (!py_armature) { + EXPP_decr2(seq, dict); + return NULL; /* error is set from Armature_CreatePyObject */ + } + if(PyDict_SetItemString(dict, name, py_armature) == -1){ //add to dictionary EXPP_decr3(seq, dict, py_armature); goto RuntimeError; |