From 3c6ef28a349bf7b1e824139df3552111db61b3be Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 25 Nov 2013 00:29:30 -0500 Subject: [PATCH] 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. --- tests/dconf-mock-dbus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.11.4.GIT