[gnome-control-center] region: Don't assert when language is empty
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Don't assert when language is empty
- Date: Fri, 28 Jan 2011 20:02:49 +0000 (UTC)
commit 4f43c11d8402004502f3a3c4468feaef2190e37a
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 28 20:01:35 2011 +0000
region: Don't assert when language is empty
Some users in the accounts service won't have any languages set,
so avoid crashing in that case.
panels/region/gnome-region-panel-lang.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-lang.c b/panels/region/gnome-region-panel-lang.c
index ff5a96d..2fce68f 100644
--- a/panels/region/gnome-region-panel-lang.c
+++ b/panels/region/gnome-region-panel-lang.c
@@ -80,8 +80,10 @@ add_other_users_language (GHashTable *ht)
}
props = g_dbus_proxy_get_cached_property (user, "Language");
name = g_variant_get_string (props, NULL);
- language = gdm_get_language_from_name (name, NULL);
- g_hash_table_insert (ht, g_strdup (name), language);
+ if (name != NULL && *name != '\0') {
+ language = gdm_get_language_from_name (name, NULL);
+ g_hash_table_insert (ht, g_strdup (name), language);
+ }
g_variant_unref (props);
g_object_unref (user);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]