diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index ea847421d0..2278db4394 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -180,9 +180,12 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb if (metaTypes.at(count) == QDBusMetaTypeId::message) --count; - // QList is actually a vector - // kids, don't try this at home - setMetaTypes(count, count ? &metaTypes.at(1) : 0); + if (count == 0) { + setMetaTypes(count, 0); + } else { + QVector types = QVector::fromList(metaTypes); + setMetaTypes(count, types.constData() + 1); + } return true; }