From 60b9355e887ee8d7449dbba3ce5fe94804b917dd Mon Sep 17 00:00:00 2001 From: scorpion-26 <58082714+scorpion-26@users.noreply.github.com> Date: Tue, 21 Feb 2023 11:38:52 +0100 Subject: [PATCH] System: Don't crash when dbus isn't installed. --- src/System.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/System.cpp b/src/System.cpp index 61e42cd..ead0e64 100644 --- a/src/System.cpp +++ b/src/System.cpp @@ -203,7 +203,12 @@ namespace System { // Try connecting to d-bus and org.bluez GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, nullptr); - ASSERT(connection, "Failed to connect to d-bus!"); + if (!connection) + { + LOG("Can't connect to d-bus! Disabling Bluetooth!"); + // dbus not found, disable bluetooth + RuntimeConfig::Get().hasBlueZ = false; + } GError* err = nullptr; GVariant* objects = g_dbus_connection_call_sync(connection, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects",