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:
authorTon Roosendaal <ton@blender.org>2008-11-02 21:05:11 +0300
committerTon Roosendaal <ton@blender.org>2008-11-02 21:05:11 +0300
commita775719e23aecfd09accff61d16ba59514538416 (patch)
treeb57fb37472e4110c28e43f402451c3df3c869a2b /source/blender/python
parent2973bd8ea27c83274669051297ee470723dfcf9d (diff)
Bugfix #17942
Python dict error: when trying to access a Bone via a key, and the key was not found, a wrong error message got printed. Fix provided by reporter Gregor Riepl. Thanks!
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Armature.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index aa3ef82a3e8..99a4398ec89 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -244,7 +244,8 @@ static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
}
if(value == NULL){ /* item not found in dict. throw exception */
char* key_str = PyString_AsString( key );
- if (key_str) {
+
+ if (key_str==NULL) {
return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
} else {
char buffer[128];