[Telepathy-commits] [telepathy-salut/master] Fix request tube channel: do not crash when requesting a tubes channel with a non existent contact

Alban Crequy alban.crequy at collabora.co.uk
Tue Nov 25 03:59:18 PST 2008


---
 src/salut-tubes-manager.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/salut-tubes-manager.c b/src/salut-tubes-manager.c
index d9a6e9c..ea0fef7 100644
--- a/src/salut-tubes-manager.c
+++ b/src/salut-tubes-manager.c
@@ -683,6 +683,12 @@ salut_tubes_manager_iface_request (TpChannelFactoryIface *iface,
     {
       status = TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED;
       chan = new_tubes_channel (fac, handle);
+      if (chan == NULL)
+        {
+          DEBUG ("Cannot create a tubes channel with handle %u",
+              handle);
+          return TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE;
+        }
       tp_channel_factory_iface_emit_new_channel (fac, (TpChannelIface *)chan,
           request);
     }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list