diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-03-28 22:17:05 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-03-28 22:17:05 -0500 |
commit | 7e19d433643bd94cd485a1b6dbf7bf042adba48e (patch) | |
tree | 4b4f4facb6836f36df8d3a8753e9b7ad97ffe629 | |
parent | d4ba4291ab9a6b7289602be7fabdea627f0815f8 (diff) | |
download | ayatana-indicator-session-7e19d433643bd94cd485a1b6dbf7bf042adba48e.tar.gz ayatana-indicator-session-7e19d433643bd94cd485a1b6dbf7bf042adba48e.tar.bz2 ayatana-indicator-session-7e19d433643bd94cd485a1b6dbf7bf042adba48e.zip |
don't create menuitems for phantom users.
-rw-r--r-- | src/service.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c index 68fbc50..a153306 100644 --- a/src/service.c +++ b/src/service.c @@ -576,12 +576,20 @@ create_switch_section (IndicatorSessionService * self, int profile) for (i=0; i<users->len; ++i) { const IndicatorSessionUser * u = g_ptr_array_index (users, i); + const char * label; GVariant * serialized_icon; if (profile == PROFILE_LOCKSCREEN && u->is_current_user) continue; - item = g_menu_item_new (get_user_label (u), NULL); + /* Sometimes we get a user without a username? bus hiccup. + I can't reproduce it, but let's not confuse users with + a meaningless menuitem. (see bug #1263228) */ + label = get_user_label (u); + if (!label || !*label) + continue; + + item = g_menu_item_new (label, NULL); g_menu_item_set_action_and_target (item, "indicator.switch-to-user", "s", u->user_name); g_menu_item_set_attribute (item, "x-canonical-type", "s", "indicator.user-menu-item"); |