summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-07-31 20:54:31 +0200
committerWill Thompson <will.thompson@collabora.co.uk>2012-07-31 20:59:31 +0200
commitae5de32be39b2dbb6df88033e74ac792ad4ace84 (patch)
tree879747c65702e0d78b5595b524dff71eec52de36
parent25dee6daf0cd5fcf72e0fb204c85074119e4af1d (diff)
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 <jonny.lamb@collabora.co.uk>
-rw-r--r--telepathy-glib/base-channel.c3
1 files changed, 3 insertions, 0 deletions
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));
}