fix for un-handled exception when entering in multiple values to a button, floats...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 9 Jun 2012 16:45:42 +0000 (16:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 9 Jun 2012 16:45:42 +0000 (16:45 +0000)
source/blender/python/intern/bpy_interface.c

index 73188b3f8302eb45b588dc41099e0ca227bca59f..ac9ff4c8ef5beb6075113c6ff7b6d93ebe43a059 100644 (file)
@@ -537,7 +537,12 @@ int BPY_button_exec(bContext *C, const char *expr, double *value, const short ve
                        val = 0.0;
 
                        for (i = 0; i < PyTuple_GET_SIZE(retval); i++) {
-                               val += PyFloat_AsDouble(PyTuple_GET_ITEM(retval, i));
+                               const double val_item = PyFloat_AsDouble(PyTuple_GET_ITEM(retval, i));
+                               if (val_item == -1 && PyErr_Occurred()) {
+                                       val = -1;
+                                       break;
+                               }
+                               val += val_item;
                        }
                }
                else {