diff options
Diffstat (limited to 'source/blender/python/intern/bpy_driver.c')
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index c88e42aa90f..833e4dc5df7 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -634,14 +634,15 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna, if (retval == NULL) { pydriver_error(driver); } - else if ((result = PyFloat_AsDouble(retval)) == -1.0 && PyErr_Occurred()) { - pydriver_error(driver); - Py_DECREF(retval); - result = 0.0; - } else { - /* all fine, make sure the "invalid expression" flag is cleared */ - driver->flag &= ~DRIVER_FLAG_INVALID; + if ((result = PyFloat_AsDouble(retval)) == -1.0 && PyErr_Occurred()) { + pydriver_error(driver); + result = 0.0; + } + else { + /* all fine, make sure the "invalid expression" flag is cleared */ + driver->flag &= ~DRIVER_FLAG_INVALID; + } Py_DECREF(retval); } |