[gnome-shell] Don't crash when removing nameless user



commit 48acc41698f21a122f5f920d171fd120218acd35
Author: Ionut Biru <ibiru archlinux org>
Date:   Mon May 9 13:03:17 2011 -0700

    Don't crash when removing nameless user
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647893

 src/gdmuser/gdm-user-manager.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gdmuser/gdm-user-manager.c b/src/gdmuser/gdm-user-manager.c
index eba9da1..e7ca833 100644
--- a/src/gdmuser/gdm-user-manager.c
+++ b/src/gdmuser/gdm-user-manager.c
@@ -777,7 +777,10 @@ remove_user (GdmUserManager *manager,
         if (gdm_user_get_object_path (user) != NULL) {
                 g_hash_table_remove (manager->priv->users_by_object_path, gdm_user_get_object_path (user));
         }
-        g_hash_table_remove (manager->priv->users_by_name, gdm_user_get_user_name (user));
+
+        if (gdm_user_get_user_name (user) != NULL) {
+                g_hash_table_remove (manager->priv->users_by_name, gdm_user_get_user_name (user));
+        }
 
         if (manager->priv->is_loaded) {
                 g_signal_emit (manager, signals[USER_REMOVED], 0, user);



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