bluetooth: fix undef errors
Filter devices to ensure they have props (idk why but sometimes they just dont have props)
This commit is contained in:
parent
d52112f25e
commit
8404771805
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue