dbus: make sure we don't unref a NULL dbus connection

See #1213
This commit is contained in:
Wim Taymans 2021-05-26 10:52:38 +02:00
parent 492caf4456
commit 751f9a9ea0
2 changed files with 4 additions and 2 deletions

View file

@ -288,7 +288,8 @@ static DBusHandlerResult filter_message (DBusConnection *connection,
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
spa_log_debug(impl->log, "dbus connection %p disconnected", this);
dbus_connection_unref(this->conn);
if (this->conn)
dbus_connection_unref(this->conn);
this->conn = NULL;
connection_emit_disconnected(this);
}