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:
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r--source/blender/python/api2_2x/Armature.c9
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;