From ae5de32be39b2dbb6df88033e74ac792ad4ace84 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 31 Jul 2012 20:54:31 +0200 Subject: BaseChannel: assert that the subclass sets TargetHandleType If the subclass sets the channel's target handle, then it had better set the target handle type in the klass. I got this wrong when porting Idle to TpBaseChannel. Fist-bumped-by: Jonny Lamb --- telepathy-glib/base-channel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c index aceb350f2..78fb6e01c 100644 --- a/telepathy-glib/base-channel.c +++ b/telepathy-glib/base-channel.c @@ -686,6 +686,8 @@ tp_base_channel_get_property (GObject *object, TpHandleRepoIface *repo = tp_base_connection_get_handles ( chan->priv->conn, klass->target_handle_type); + g_assert (klass->target_handle_type != TP_HANDLE_TYPE_NONE); + g_assert (repo != NULL); g_value_set_string (value, tp_handle_inspect (repo, chan->priv->target)); } else @@ -702,6 +704,7 @@ tp_base_channel_get_property (GObject *object, TpHandleRepoIface *repo = tp_base_connection_get_handles ( chan->priv->conn, TP_HANDLE_TYPE_CONTACT); + g_assert (repo != NULL); g_assert (chan->priv->initiator != 0); g_value_set_string (value, tp_handle_inspect (repo, chan->priv->initiator)); } -- cgit v1.2.3