From 9a3e46e73ee201771c8bc9ae9f95adecbb71fe69 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 28 Jun 2013 18:38:51 -0500 Subject: in service.c's add_user(), test for NULL before adding the user struct to our collection --- src/service.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/service.c b/src/service.c index a9f2f65..36ef282 100644 --- a/src/service.c +++ b/src/service.c @@ -210,14 +210,16 @@ add_user (IndicatorSessionService * self, guint uid) { IndicatorSessionUser * u; - /* update our user table */ - u = indicator_session_users_get_user (self->priv->backend_users, uid); - g_hash_table_insert (self->priv->users, GUINT_TO_POINTER(uid), u); + if ((u = indicator_session_users_get_user (self->priv->backend_users, uid))) + { + /* update our user table */ + g_hash_table_insert (self->priv->users, GUINT_TO_POINTER(uid), u); - /* enqueue rebuilds for the affected sections */ - rebuild_switch_section_soon (self); - if (u->is_current_user) - rebuild_header_soon (self); + /* queue rebuilds for the affected sections */ + rebuild_switch_section_soon (self); + if (u->is_current_user) + rebuild_header_soon (self); + } } static void -- cgit v1.2.3