aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-12 16:07:33 -0600
committerTed Gould <ted@gould.cx>2010-03-12 16:07:33 -0600
commit78211dc46ae22a439653df6db0f3b6e9c67160f0 (patch)
treea18a8d3fb95a3147c65ca01d126206ef49db7d20 /src/session-service.c
parent5d784227da6b87b8588724ac1d894c6116fc2b01 (diff)
downloadayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.tar.gz
ayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.tar.bz2
ayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.zip
Protecting from a NULL object
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 6c4dd1b..b88ee30 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -622,15 +622,19 @@ restart_dir_changed (void)
dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart Required..."));
}
dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_ICON_NAME, "emblem-important");
- session_dbus_set_name(session_dbus, ICON_RESTART);
- } else {
+ if (session_dbus != NULL) {
+ session_dbus_set_name(session_dbus, ICON_RESTART);
+ }
+ } else {
if (supress_confirmations()) {
dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart"));
} else {
dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart..."));
}
dbusmenu_menuitem_property_remove(restart_mi, DBUSMENU_MENUITEM_PROP_ICON_NAME);
- session_dbus_set_name(session_dbus, ICON_DEFAULT);
+ if (session_dbus != NULL) {
+ session_dbus_set_name(session_dbus, ICON_DEFAULT);
+ }
}
return;