From 84047718053f7426611ebaf0fb112b22f8b8373f Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 1 May 2025 12:38:16 +1000 Subject: bluetooth: fix undef errors Filter devices to ensure they have props (idk why but sometimes they just dont have props) --- services/Bluetooth.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services') diff --git a/services/Bluetooth.qml b/services/Bluetooth.qml index 4092212..c7ed727 100644 --- a/services/Bluetooth.qml +++ b/services/Bluetooth.qml @@ -40,7 +40,7 @@ Singleton { command: ["fish", "-c", `for a in (bluetoothctl devices | cut -d ' ' -f 2); bluetoothctl info $a | jq -R 'reduce (inputs / ":") as [$key, $value] ({}; .[$key | ltrimstr("\t")] = ($value | ltrimstr(" ")))' | jq -c --arg addr $a '.Address = $addr'; end | jq -sc`] stdout: SplitParser { onRead: data => { - const devices = JSON.parse(data); + const devices = JSON.parse(data).filter(d => d.name); const rDevices = root.devices; const len = rDevices.length; -- cgit v1.2.3-freya