[telepathy-mission-control/master] _mcd_dispatch_operation_run_clients: make it harmless to call this method with no channels left

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Oct 28 10:35:54 PDT 2009


If there are no channels left, we don't want to run observers, approvers
or handlers (there's nothing to give them, and they'd just get confused).
---
 src/mcd-dispatch-operation.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index ca98c88..d5e2680 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1779,7 +1779,11 @@ _mcd_dispatch_operation_run_clients (McdDispatchOperation *self)
 {
     g_object_ref (self);
 
-    _mcd_dispatch_operation_run_observers (self);
+    if (self->priv->channels != NULL)
+    {
+        _mcd_dispatch_operation_run_observers (self);
+    }
+
     self->priv->invoked_observers_if_needed = TRUE;
 
     /* If nobody is bypassing approval, then we want to run approvers as soon
@@ -1789,7 +1793,8 @@ _mcd_dispatch_operation_run_clients (McdDispatchOperation *self)
      *
      * However, if a handler bypasses approval, we must wait til the observers
      * return, then run that handler, then proceed with the other handlers. */
-    if (!_mcd_dispatch_operation_handlers_can_bypass_approval (self))
+    if (!_mcd_dispatch_operation_handlers_can_bypass_approval (self)
+        && self->priv->channels != NULL)
     {
         self->priv->tried_handlers_before_approval = TRUE;
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list