diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-01-31 11:02:35 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-01-31 11:03:34 -0500 |
commit | 3381a536337b69a3ba54543d69624fb2274ffa66 (patch) | |
tree | c9a6c9815136c6bd977d3979be85b54384aaa590 /gsettings | |
parent | a6b6f296792f2f5dc985812d5d221819be970593 (diff) | |
download | dconf-3381a536337b69a3ba54543d69624fb2274ffa66.tar.gz |
Don't crash on DBus connection failure
When adding matches, if we can't connect to DBus, the code will
presently crash. This fixes that.
Diffstat (limited to 'gsettings')
-rw-r--r-- | gsettings/dconfsettingsbackend.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gsettings/dconfsettingsbackend.c b/gsettings/dconfsettingsbackend.c index abba2a1..d978646 100644 --- a/gsettings/dconfsettingsbackend.c +++ b/gsettings/dconfsettingsbackend.c @@ -518,6 +518,13 @@ add_match_done (GObject *source, GError *error = NULL; GVariant *reply; + /* couldn't connect to DBus */ + if (source == NULL) + { + outstanding_watch_free (watch); + return; + } + reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source), result, &error); |