aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-28 18:38:51 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-28 18:38:51 -0500
commit9a3e46e73ee201771c8bc9ae9f95adecbb71fe69 (patch)
tree356fc3cdf85c209e328e01b6938119a8b1f89dc0
parent0180339dd65daa9878b93e06ad8da3742999dd3d (diff)
downloadayatana-indicator-session-9a3e46e73ee201771c8bc9ae9f95adecbb71fe69.tar.gz
ayatana-indicator-session-9a3e46e73ee201771c8bc9ae9f95adecbb71fe69.tar.bz2
ayatana-indicator-session-9a3e46e73ee201771c8bc9ae9f95adecbb71fe69.zip
in service.c's add_user(), test for NULL before adding the user struct to our collection
-rw-r--r--src/service.c16
1 files 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