summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2014-08-27 23:37:02 +0200
committerDavid Edmundson <kde@davidedmundson.co.uk>2014-08-27 23:37:02 +0200
commitfee87738e85e338f61228e0474b8ead1a23c4453 (patch)
treeb8650ab0e7b9f6017dbb3b0c13fe19b6b2ff2f82
parente460dfd8e1801412dedb11d8211642501f4989c5 (diff)
Avoid trying to load invalid channelRequest
If there is no relevant channel-request properties in the supplied handlerInfo we can assume the channelRequest is bogus and we should avoid trying to load it. https://bugs.freedesktop.org/show_bug.cgi?id=77986
-rw-r--r--TelepathyQt/client-registrar.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/TelepathyQt/client-registrar.cpp b/TelepathyQt/client-registrar.cpp
index 6ed99328..64905aab 100644
--- a/TelepathyQt/client-registrar.cpp
+++ b/TelepathyQt/client-registrar.cpp
@@ -193,6 +193,12 @@ void ClientObserverAdaptor::ObserveChannels(const QDBusObjectPath &accountPath,
ObjectImmutablePropertiesMap reqPropsMap = qdbus_cast<ObjectImmutablePropertiesMap>(
observerInfo.value(QLatin1String("request-properties")));
foreach (const QDBusObjectPath &reqPath, requestsSatisfied) {
+ //don't load the channelRequest objects in requestsSatisfied if the properties are not supplied with the handler info
+ //as the channelRequest is probably invalid
+ //this works around https://bugs.freedesktop.org/show_bug.cgi?id=77986
+ if (reqPropsMap.value(reqPath).isEmpty()) {
+ continue;
+ }
ChannelRequestPtr channelRequest = ChannelRequest::create(invocation->acc,
reqPath.path(), reqPropsMap.value(reqPath));
invocation->chanReqs.append(channelRequest);
@@ -435,6 +441,12 @@ void ClientHandlerAdaptor::HandleChannels(const QDBusObjectPath &accountPath,
ObjectImmutablePropertiesMap reqPropsMap = qdbus_cast<ObjectImmutablePropertiesMap>(
handlerInfo.value(QLatin1String("request-properties")));
foreach (const QDBusObjectPath &reqPath, requestsSatisfied) {
+ //don't load the channelRequest objects in requestsSatisfied if the properties are not supplied with the handler info
+ //as the channelRequest is probably invalid
+ //this works around https://bugs.freedesktop.org/show_bug.cgi?id=77986
+ if (reqPropsMap.value(reqPath).isEmpty()) {
+ continue;
+ }
ChannelRequestPtr channelRequest = ChannelRequest::create(invocation->acc,
reqPath.path(), reqPropsMap.value(reqPath));
invocation->chanReqs.append(channelRequest);