fix for un-handled exception when entering in multiple values to a button, floats were not correctly checked for.

This commit is contained in:
2012-06-09 16:45:42 +00:00
parent 56c5c63f57
commit 2f60d9b0b9

View 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 {