gdbus: Fix runtime warning with debug enabled

With debug enabled, g_dbus_connection_call_done() will throw a
g_warning() if the call failed (on purpose or not) while trying to the
serial of a non-existant reply.

(/builds/GNOME/glib/_build/gio/tests/gdbus-connection:26921): GLib-GIO-CRITICAL **: 10:10:16.311: g_dbus_message_get_reply_serial: assertion 'G_IS_DBUS_MESSAGE (message)' failed
This commit is contained in:
Bastien Nocera 2019-12-11 11:38:24 +01:00
parent 8fd71dccc5
commit 145dc5a49e

View File

@ -5726,17 +5726,19 @@ g_dbus_connection_call_done (GObject *source,
_g_dbus_debug_print_lock ();
g_print ("========================================================================\n"
"GDBus-debug:Call:\n"
" <<<< ASYNC COMPLETE %s() (serial %d)\n"
" ",
state->method_name,
g_dbus_message_get_reply_serial (reply));
" <<<< ASYNC COMPLETE %s()",
state->method_name);
if (reply != NULL)
{
g_print ("SUCCESS\n");
g_print (" (serial %d)\n"
" SUCCESS\n",
g_dbus_message_get_reply_serial (reply));
}
else
{
g_print ("FAILED: %s\n",
g_print ("\n"
" FAILED: %s\n",
error->message);
}
_g_dbus_debug_print_unlock ();