Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-06-30 18:44:12 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-06-30 18:44:12 +0400
commit5b15a610ee2688a42f24b6ef16a7fce5a4aa96df (patch)
treeea8ad675943d66b72baf83bdafe5604b42fb4344 /source/blender/python
parent6a3e8e7fff4e577bea02966546293760c19deec7 (diff)
Fix crash in python API (Campbell: please check :) ) -- using myLamp.setType(number) crashed blender (reported in IRC by Djoef)
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Lamp.c6
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" ) )