Skip to content

Commit 6c508c3

Browse files
committed
fix crash
1 parent 94606fb commit 6c508c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Services/Manager.vala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class Bluetooth.Services.ObjectManager : Object {
4242
public bool is_connected {get; private set; default = false; }
4343

4444
private bool is_registered = false;
45+
private string enabled_key = "enabled";
4546

4647
private Settings? settings = null;
4748
private GLib.DBusObjectManagerClient object_manager;
@@ -56,6 +57,7 @@ public class Bluetooth.Services.ObjectManager : Object {
5657
settings_schema = SettingsSchemaSource.get_default ().lookup (PANEL_SCHEMA, true);
5758
if (settings_schema != null) {
5859
settings = new Settings (PANEL_SCHEMA);
60+
enabled_key = "bluetooth-enabled";
5961
}
6062
}
6163
create_manager.begin ();
@@ -384,7 +386,7 @@ public class Bluetooth.Services.ObjectManager : Object {
384386
}
385387

386388
if (settings != null) {
387-
settings.set_boolean ("bluetooth-enabled", state);
389+
settings.set_boolean (enabled_key, state);
388390
}
389391

390392
if (!state) {

0 commit comments

Comments
 (0)