[Telepathy-commits] [telepathy-mission-control/master] Don't crash if there are no old-style handlers for a channel type
Will Thompson
will.thompson at collabora.co.uk
Wed Dec 17 04:17:27 PST 2008
---
src/mcd-dispatcher.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 0f742d1..f2708af 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -775,10 +775,9 @@ start_old_channel_handler (McdDispatcherContext *context)
{
McdChannelHandler *chandler;
McdDispatcherPrivate *priv;
- McdChannel *channel;
+ McdChannel *channel = NULL;
const gchar *protocol;
GHashTable *channel_handler;
-
g_return_if_fail (context);
@@ -790,10 +789,13 @@ start_old_channel_handler (McdDispatcherContext *context)
g_hash_table_lookup (priv->channel_handler_hash,
mcd_channel_get_channel_type (channel));
- chandler = g_hash_table_lookup (channel_handler, protocol);
- if (chandler == NULL)
- chandler = g_hash_table_lookup (channel_handler, "default");
-
+ if (channel_handler != NULL)
+ {
+ chandler = g_hash_table_lookup (channel_handler, protocol);
+ if (chandler == NULL)
+ chandler = g_hash_table_lookup (channel_handler, "default");
+ }
+
if (chandler == NULL)
{
GError *mc_error;
--
1.5.6.5
More information about the Telepathy-commits
mailing list