diff options
Diffstat (limited to 'source/blender/python/api2_2x/BGL.h')
-rw-r--r-- | source/blender/python/api2_2x/BGL.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/BGL.h b/source/blender/python/api2_2x/BGL.h index ce972795322..461f5bc9372 100644 --- a/source/blender/python/api2_2x/BGL.h +++ b/source/blender/python/api2_2x/BGL.h @@ -323,8 +323,13 @@ typedef struct _Buffer { #define ret_def_GLstring const unsigned char *ret_str; #define ret_set_GLstring ret_str= -#define ret_ret_GLstring return PyString_FromString(ret_str); - +#define ret_ret_GLstring \ + if (ret_str) {\ + return PyString_FromString(ret_str);\ + } else {\ + PyErr_SetString(PyExc_AttributeError, "could not get opengl string");\ + return NULL;\ + } #endif /* EXPP_BGL_H */ |