diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-06-30 18:44:12 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-06-30 18:44:12 +0400 |
commit | 5b15a610ee2688a42f24b6ef16a7fce5a4aa96df (patch) | |
tree | ea8ad675943d66b72baf83bdafe5604b42fb4344 | |
parent | 6a3e8e7fff4e577bea02966546293760c19deec7 (diff) |
Fix crash in python API (Campbell: please check :) ) -- using myLamp.setType(number) crashed blender (reported in IRC by Djoef)
-rw-r--r-- | source/blender/python/api2_2x/Lamp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index ef3174ac4ed..d9034847a85 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -1525,7 +1525,11 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value ) if( !value ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ) ); - + + if( !type ) + return EXPP_ReturnPyObjError ( PyExc_AttributeError, + "expected string argument" ); + /* check for valid arguments, set type accordingly */ if( !strcmp( type, "Lamp" ) ) |