diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 00:29:30 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 00:34:44 -0500 |
commit | 3c6ef28a349bf7b1e824139df3552111db61b3be (patch) | |
tree | 1da5e014701b18eaa9657b6399027132b78ceca3 | |
parent | 1e0a743ab0ce1adb844c4540531d7794668ffd22 (diff) | |
download | dconf-3c6ef28a349bf7b1e824139df3552111db61b3be.tar.gz |
mock dbus: allow for NULL replies in case of error
But make sure an error is set if NULL is returned and the caller passed
in an error pointer.
-rw-r--r-- | tests/dconf-mock-dbus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/dconf-mock-dbus.c b/tests/dconf-mock-dbus.c index 1ae7ba0..e20b61a 100644 --- a/tests/dconf-mock-dbus.c +++ b/tests/dconf-mock-dbus.c @@ -65,5 +65,7 @@ dconf_engine_dbus_call_sync_func (GBusType bus_type, g_variant_unref (parameters); - return g_variant_take_ref (reply); + g_assert (reply != NULL || (error == NULL || *error != NULL)); + + return reply ? g_variant_take_ref (reply) : NULL; } |