summaryrefslogtreecommitdiff
path: root/libupower-glib
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-10-08 17:01:39 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-10-08 17:02:57 +0200
commit03c4abbfb525528a6b2335363dea9929d8516f90 (patch)
treedcc892c374e33c5a0771e26d26010f568b48939c /libupower-glib
parentecc4e379ccc2f1e3b9c8ce2853657c5726513c5e (diff)
downloadupower-03c4abbfb525528a6b2335363dea9929d8516f90.tar.gz
libupower-glib: Fix error handling
In up_client_get_properties_sync(), don't set the passed GError** to NULL, instead set the actual pointed-to GError* to NULL by default. Fixes proper error reporting back to the client if something does fail.
Diffstat (limited to 'libupower-glib')
-rw-r--r--libupower-glib/up-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index 8e7a2d5..757e4a1 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -328,7 +328,8 @@ up_client_get_properties_sync (UpClient *client, GCancellable *cancellable, GErr
if (!client->priv->prop_proxy)
goto out;
- error = NULL;
+ if (error != NULL)
+ *error = NULL;
ret = dbus_g_proxy_call (client->priv->prop_proxy, "GetAll", error,
G_TYPE_STRING, "org.freedesktop.UPower",
G_TYPE_INVALID,