diff options
author | Ted Gould <ted@gould.cx> | 2010-03-12 16:07:33 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-12 16:07:33 -0600 |
commit | 78211dc46ae22a439653df6db0f3b6e9c67160f0 (patch) | |
tree | a18a8d3fb95a3147c65ca01d126206ef49db7d20 | |
parent | 5d784227da6b87b8588724ac1d894c6116fc2b01 (diff) | |
download | ayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.tar.gz ayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.tar.bz2 ayatana-indicator-session-78211dc46ae22a439653df6db0f3b6e9c67160f0.zip |
Protecting from a NULL object
-rw-r--r-- | src/session-service.c | 10 |
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; |