diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-11 15:17:56 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:51:45 -0300 |
commit | a24e8ed2811a9d4f116d3c2e05721a4e47b7a09f (patch) | |
tree | aa22c46d7ca1ab7a5562bc83d7bfe8e35c89df62 /libpyside | |
parent | 67f0db5a2b6ad96d41bda2b96112bba3cba55862 (diff) |
Don't crash when a unknown type is given as a meta call argument.
Diffstat (limited to 'libpyside')
-rw-r--r-- | libpyside/signalmanager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp index 75a0d197f..2581d7181 100644 --- a/libpyside/signalmanager.cpp +++ b/libpyside/signalmanager.cpp @@ -324,8 +324,14 @@ static int PySide::callMethod(QObject* object, int id, void** args) void* data = args[i+1]; const char* dataType = paramTypes[i].constData(); - PyObject* arg = Shiboken::TypeResolver::get(dataType)->toPython(data); - PyTuple_SET_ITEM(preparedArgs, i, arg); + Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(dataType); + if (tr) { + PyObject* arg = tr->toPython(data); + PyTuple_SET_ITEM(preparedArgs, i, arg); + } else { + PyErr_Format(PyExc_TypeError, "Can't call meta function because I have no idea how to handle %s", dataType); + return -1; + } } QString methodName = method.signature(); |