From 03c4abbfb525528a6b2335363dea9929d8516f90 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 8 Oct 2013 17:01:39 +0200 Subject: 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. --- libupower-glib/up-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3