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!
This commit is contained in:
@@ -244,7 +244,8 @@ static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
|
|||||||
}
|
}
|
||||||
if(value == NULL){ /* item not found in dict. throw exception */
|
if(value == NULL){ /* item not found in dict. throw exception */
|
||||||
char* key_str = PyString_AsString( key );
|
char* key_str = PyString_AsString( key );
|
||||||
if (key_str) {
|
|
||||||
|
if (key_str==NULL) {
|
||||||
return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
|
return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
|
||||||
} else {
|
} else {
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
|
|||||||
Reference in New Issue
Block a user