summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2018-11-15 17:52:44 +0800
committerraveit65 <[email protected]>2018-11-15 12:33:04 +0100
commitb9bd3f63367f7b7abf6fc1ef86b5a8edd92d775f (patch)
tree2aedb086fe90e94ee3c960041fcd5e4f4c79457d
parenta34f531da4f03eecfc38414295ebe70742dfad71 (diff)
downloadmate-panel-b9bd3f63367f7b7abf6fc1ef86b5a8edd92d775f.tar.bz2
mate-panel-b9bd3f63367f7b7abf6fc1ef86b5a8edd92d775f.tar.xz
Check if manager->proxy is NULL
-rw-r--r--mate-panel/libpanel-util/panel-session-manager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mate-panel/libpanel-util/panel-session-manager.c b/mate-panel/libpanel-util/panel-session-manager.c
index 191ca2dd..ef99cad2 100644
--- a/mate-panel/libpanel-util/panel-session-manager.c
+++ b/mate-panel/libpanel-util/panel-session-manager.c
@@ -82,6 +82,9 @@ panel_session_manager_request_logout (PanelSessionManager *manager,
g_return_if_fail (PANEL_IS_SESSION_MANAGER (manager));
+ if (manager->proxy == NULL)
+ return;
+
ret = g_dbus_proxy_call_sync (manager->proxy, "Logout",
g_variant_new ("(u)", mode),
G_DBUS_CALL_FLAGS_NONE,
@@ -105,6 +108,9 @@ panel_session_manager_request_shutdown (PanelSessionManager *manager)
g_return_if_fail (PANEL_IS_SESSION_MANAGER (manager));
+ if (manager->proxy == NULL)
+ return;
+
ret = g_dbus_proxy_call_sync (manager->proxy, "Shutdown",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
@@ -129,6 +135,9 @@ panel_session_manager_is_shutdown_available (PanelSessionManager *manager)
g_return_val_if_fail (PANEL_IS_SESSION_MANAGER (manager), FALSE);
+ if (manager->proxy == NULL)
+ return FALSE;
+
ret = g_dbus_proxy_call_sync (manager->proxy, "CanShutdown",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,