diff options
author | Martin Pitt <martinpitt@gnome.org> | 2013-11-08 14:59:50 +0100 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-11-08 14:59:50 +0100 |
commit | 0d64bbddaa0078ef148d609a3cfad854cf00d7de (patch) | |
tree | d7b64daf42a4815af4d51d657826cf4f58bb8db7 | |
parent | e96f5349f905d5005bd29c5a4786c10fb86d1453 (diff) | |
download | upower-0d64bbddaa0078ef148d609a3cfad854cf00d7de.tar.gz |
lib: Fix segfault on getting property when daemon is not running
This fixes "upower --version" when the daemon is not running, and thus the
client proxy is NULL.
-rw-r--r-- | libupower-glib/up-client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c index 35d7b5d..17fb02d 100644 --- a/libupower-glib/up-client.c +++ b/libupower-glib/up-client.c @@ -322,6 +322,9 @@ up_client_get_property (GObject *object, UpClient *client; client = UP_CLIENT (object); + if (client->priv->proxy == NULL) + return; + switch (prop_id) { case PROP_DAEMON_VERSION: g_value_set_string (value, up_client_glue_get_daemon_version (client->priv->proxy)); |