[empathy: 1/5] Don't assume there is always a settings widget available



commit 878756780bc822f5626101d6abd2157b99e9e3c8
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Thu Mar 4 12:16:26 2010 +0000

    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

 src/empathy-account-assistant.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 97b7f96..c944ccc 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]