gdbus: Fail to send NULL messages

This should make it safe to call g_dbus_send_message with a NULL
message which is more likely to happen now that g_dbus_create_reply
returns NULL when the message is marked with NO_REPLY flag.
This commit is contained in:
Luiz Augusto von Dentz 2018-01-28 11:44:32 -02:00
parent 5475f8bb2f
commit e3767039f4

View File

@ -1502,6 +1502,9 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
{
dbus_bool_t result = FALSE;
if (!message)
return FALSE;
if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
dbus_message_set_no_reply(message, TRUE);
else if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) {