aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-04 20:16:26 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-05 00:40:17 +0800
commit878756780bc822f5626101d6abd2157b99e9e3c8 (patch)
treea002d80f5847ea8850af3333e30b6f8d7e2ca418
parent3b09acab5942361ac9ab12dc0a3bbbd10ffa42d7 (diff)
downloadgsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar.gz
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar.bz2
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar.lz
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar.xz
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.tar.zst
gsoc2013-empathy-878756780bc822f5626101d6abd2157b99e9e3c8.zip
Don't assume there is always a settings widget available
When we exit the assistant with just salut accounts there is no account widget for it in the normal sense, so don't crash if there isn't one. Fixes: #611792
-rw-r--r--src/empathy-account-assistant.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 97b7f9692..c944ccc98 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -348,21 +348,26 @@ account_assistant_apply_account_and_finish (EmpathyAccountAssistant *self,
EmpathyAccountSettings *settings)
{
EmpathyAccountAssistantPriv *priv = GET_PRIV (self);
- gchar *display_name;
if (settings == NULL)
return;
priv->is_creating = TRUE;
- /* set default display name */
- display_name = empathy_account_widget_get_default_display_name (
- priv->current_widget_object);
+ /* set default display name, if there is no current widget then assume the
+ * display name was already set correctly. e.g. salut account creation */
+ if (priv->current_widget_object != NULL)
+ {
+ gchar *display_name;
+
+ display_name = empathy_account_widget_get_default_display_name (
+ priv->current_widget_object);
- empathy_account_settings_set_display_name_async (settings,
- display_name, NULL, NULL);
+ empathy_account_settings_set_display_name_async (settings,
+ display_name, NULL, NULL);
- g_free (display_name);
+ g_free (display_name);
+ }
empathy_account_settings_apply_async (settings,
account_assistant_apply_account_cb, self);