[Telepathy-commits] [telepathy-qt4/master] PendingHandles: Warn when trying to access handles without finished.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Mar 24 10:08:31 PDT 2009


---
 TelepathyQt4/Client/pending-handles.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/Client/pending-handles.cpp b/TelepathyQt4/Client/pending-handles.cpp
index 5b300d5..9c6ad3c 100644
--- a/TelepathyQt4/Client/pending-handles.cpp
+++ b/TelepathyQt4/Client/pending-handles.cpp
@@ -247,6 +247,14 @@ const UIntList &PendingHandles::handlesToReference() const
  */
 ReferencedHandles PendingHandles::handles() const
 {
+    if (!isFinished()) {
+        warning() << "PendingHandles::handles() called before finished";
+        return ReferencedHandles();
+    } else if (!isValid()) {
+        warning() << "PendingHandles::handles() called when not valid";
+        return ReferencedHandles();
+    }
+
     return mPriv->handles;
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list