diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-07 13:50:10 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-07 13:50:10 +0100 |
commit | 09ece4e16b3a8b99d92a9f48610d92949edfa732 (patch) | |
tree | a4b94e765b68371a95d39dd23d56ae3e55e1ef49 | |
parent | 00fed1ec56499e7a93c8d9c7c0a56fa101b24416 (diff) |
future-account: check we have AM, CM, and protocol in constructed
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | telepathy-glib/future-account.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c index b8235e906..108295837 100644 --- a/telepathy-glib/future-account.c +++ b/telepathy-glib/future-account.c @@ -165,6 +165,10 @@ tp_future_account_constructed (GObject *object) if (chain_up != NULL) chain_up (object); + g_assert (priv->account_manager != NULL); + g_assert (priv->cm_name != NULL); + g_assert (priv->proto_name != NULL); + priv->parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); @@ -1151,16 +1155,12 @@ tp_future_account_create_account_async (TpFutureAccount *self, return; } - if (priv->account_manager == NULL - || priv->cm_name == NULL - || priv->proto_name == NULL - || priv->display_name == NULL) + if (priv->display_name == NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, - "Future account is missing one or more of: account manager, " - "connection manager name, protocol name, or display name"); + "The future account needs a display name to create the account"); return; } |