summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-11 15:17:56 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:51:45 -0300
commita24e8ed2811a9d4f116d3c2e05721a4e47b7a09f (patch)
treeaa22c46d7ca1ab7a5562bc83d7bfe8e35c89df62
parent67f0db5a2b6ad96d41bda2b96112bba3cba55862 (diff)
Don't crash when a unknown type is given as a meta call argument.
-rw-r--r--libpyside/signalmanager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 75a0d197..2581d718 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();