gnome-power-manager r3079 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3079 - in trunk: . src
- Date: Sat, 8 Nov 2008 16:27:57 +0000 (UTC)
Author: rhughes
Date: Sat Nov 8 16:27:57 2008
New Revision: 3079
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3079&view=rev
Log:
2008-11-08 Richard Hughes <richard hughsie com>
* src/egg-console-kit.c: (egg_console_kit_is_local),
(egg_console_kit_is_active):
Don't crash if we start up not on active session.
Modified:
trunk/ChangeLog
trunk/src/egg-console-kit.c
Modified: trunk/src/egg-console-kit.c
==============================================================================
--- trunk/src/egg-console-kit.c (original)
+++ trunk/src/egg-console-kit.c Sat Nov 8 16:27:57 2008
@@ -70,12 +70,17 @@
gboolean
egg_console_kit_is_local (EggConsoleKit *console)
{
- gboolean ret;
+ gboolean ret = FALSE;
gboolean value = FALSE;
GError *error = NULL;
g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
- g_return_val_if_fail (console->priv->proxy_session != NULL, FALSE);
+
+ /* maybe console kit does not know about our session */
+ if (console->priv->proxy_session == NULL) {
+ egg_warning ("no ConsoleKit session");
+ goto out;
+ }
/* is our session local */
ret = dbus_g_proxy_call (console->priv->proxy_session, "IsLocal", &error, G_TYPE_INVALID,
@@ -105,7 +110,12 @@
GError *error = NULL;
g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
- g_return_val_if_fail (console->priv->proxy_session != NULL, FALSE);
+
+ /* maybe console kit does not know about our session */
+ if (console->priv->proxy_session == NULL) {
+ egg_warning ("no ConsoleKit session");
+ goto out;
+ }
/* is our session active */
ret = dbus_g_proxy_call (console->priv->proxy_session, "IsActive", &error, G_TYPE_INVALID,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]