mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 03:02:49 +00:00
System: Don't crash when dbus isn't installed.
This commit is contained in:
parent
991864775b
commit
60b9355e88
1 changed files with 6 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue