telepathy-qt: dbus-tubes: Don't emit a signal if the service is misbehaving ; instead, print out a warning.

Dario Freddi drf at kemper.freedesktop.org
Tue Jul 3 15:08:40 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 6f0844304e2e7479332c21b2257f1065257f73a7
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=6f0844304e2e7479332c21b2257f1065257f73a7

Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date:   Thu Jun  9 16:59:16 2011 +0200

dbus-tubes: Don't emit a signal if the service is misbehaving; instead, print out a warning.

---

 TelepathyQt/dbus-tube-channel.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/TelepathyQt/dbus-tube-channel.cpp b/TelepathyQt/dbus-tube-channel.cpp
index 3e967bc..01eb919 100644
--- a/TelepathyQt/dbus-tube-channel.cpp
+++ b/TelepathyQt/dbus-tube-channel.cpp
@@ -387,8 +387,12 @@ void DBusTubeChannel::onContactsRetrieved(const QUuid &uuid, const QList<Contact
 
         // Remove it from our connections hash
         foreach (const Tp::ContactPtr &contact, contacts) {
-            mPriv->busNames.remove(contact);
-            removed << contact;
+            if (mPriv->busNames.contains(contact)) {
+                mPriv->busNames.remove(contact);
+                removed << contact;
+            } else {
+                warning() << "Trying to remove a bus name which has not been retrieved previously!";
+            }
         }
 
         // Time for us to emit the signal



More information about the telepathy-commits mailing list