[Telepathy-commits] [telepathy-glib/master] tp_base_connection_register: critically warn and return if arguments are bad

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Mar 3 06:34:47 PST 2009


bus_name and object_path are documented as non-NULL, so this is checked
even though it's not the usual GObject usage.
---
 telepathy-glib/base-connection.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index bd0fdc4..f806020 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -1499,6 +1499,11 @@ tp_base_connection_register (TpBaseConnection *self,
   gchar *safe_proto;
   gchar *unique_name;
 
+  g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), FALSE);
+  g_return_val_if_fail (cm_name != NULL, FALSE);
+  g_return_val_if_fail (bus_name != NULL, FALSE);
+  g_return_val_if_fail (object_path != NULL, FALSE);
+
   if (tp_connection_manager_check_valid_protocol_name (priv->protocol, NULL))
     {
       safe_proto = g_strdelimit (g_strdup (priv->protocol), "-", '_');
-- 
1.5.6.5




More information about the telepathy-commits mailing list