[gnome-control-center] user-accounts: fix language chooser response



commit 6f13d0ad8b71b0c49593b87bfa7b7066e9aa32f6
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Oct 6 14:35:22 2014 +0200

    user-accounts: fix language chooser response
    
    If the language chooser is confirmed and no language is selected,
    "Other..." is shown as user's language and the following error is printed:
    
    (gnome-control-center:14608): AccountsService-CRITICAL **:
    act_user_set_language: assertion 'language != NULL' failed

 panels/user-accounts/um-user-panel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index b30619c..71431ef 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -820,7 +820,7 @@ language_response (GtkDialog         *dialog,
 {
         GtkWidget *combo;
         ActUser *user;
-        gchar *lang;
+        gchar *lang = NULL;
         GtkTreeModel *model;
         GtkTreeIter iter;
 
@@ -831,6 +831,9 @@ language_response (GtkDialog         *dialog,
 
         if (response_id == GTK_RESPONSE_OK) {
                 lang = g_strdup (cc_language_chooser_get_language (GTK_WIDGET (dialog)));
+        }
+
+        if (lang != NULL) {
                 act_user_set_language (user, lang);
         }
         else {


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