[telepathy-mission-control/master] Assert in various places that the CM parameters are non-NULL

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Apr 15 09:07:21 PDT 2009


_mcd_connection_connect() behaves differently (calling back into Account!)
if the CM parameters are NULL, so this is an important assertion to be
able to reason correctly about the behaviour of the connection process.
---
 src/mcd-account-connection.c |    2 ++
 src/mcd-account.c            |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mcd-account-connection.c b/src/mcd-account-connection.c
index f1d55ec..525390d 100644
--- a/src/mcd-account-connection.c
+++ b/src/mcd-account-connection.c
@@ -70,6 +70,7 @@ _mcd_account_connection_begin (McdAccount *account)
     ctx = g_malloc (sizeof (McdAccountConnectionContext));
     ctx->i_filter = 0;
     ctx->params = _mcd_account_dup_parameters (account);
+    g_assert (ctx->params != NULL);
     _mcd_account_set_connection_context (account, ctx);
     mcd_account_connection_proceed (account, TRUE);
 }
@@ -88,6 +89,7 @@ mcd_account_connection_proceed (McdAccount *account, gboolean success)
      * from mcd_manager_create_connection() */
     ctx = _mcd_account_get_connection_context (account);
     g_return_if_fail (ctx != NULL);
+    g_return_if_fail (ctx->params != NULL);
 
     if (success)
     {
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 5e130d0..31bcbbe 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -497,6 +497,8 @@ _mcd_account_connect (McdAccount *account, GHashTable *params)
 {
     McdAccountPrivate *priv = account->priv;
 
+    g_assert (params != NULL);
+
     if (!priv->connection)
     {
         McdConnection *connection;
-- 
1.5.6.5




More information about the telepathy-commits mailing list