diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-06-05 14:55:11 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-06-05 14:55:11 -0500 |
commit | 0941a2b3ec568323b23e69993c88eebe8529c966 (patch) | |
tree | 7931528c757a1b2f37923c84c49d3819909a402e | |
parent | bcc1d391440ca6df3b57f30c440b761f2034348f (diff) | |
download | ayatana-indicator-session-0941a2b3ec568323b23e69993c88eebe8529c966.tar.gz ayatana-indicator-session-0941a2b3ec568323b23e69993c88eebe8529c966.tar.bz2 ayatana-indicator-session-0941a2b3ec568323b23e69993c88eebe8529c966.zip |
bugfix: in machine_sleep_with_context(), don't call the proxy method if we don't have a proxy
-rw-r--r-- | src/device-menu-mgr.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 0af0af7..20597b0 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -174,18 +174,16 @@ machine_sleep_from_hibernate (DbusmenuMenuitem * mi G_GNUC_UNUSED, static void machine_sleep_with_context (DeviceMenuMgr* self, const gchar* type) { - if (self->up_main_proxy == NULL) { - g_warning("Can not %s as no upower proxy", type); - } - - dbus_g_proxy_begin_call(self->up_main_proxy, - type, - NULL, - NULL, - NULL, - G_TYPE_INVALID); - - return; + if (self->up_main_proxy == NULL) + { + g_warning("Can not %s as no upower proxy", type); + } + else + { + dbus_g_proxy_begin_call (self->up_main_proxy, type, + NULL, NULL, NULL, + G_TYPE_INVALID); + } } /* A response to getting the suspend property */ |