Skip to content

Commit

Permalink
fix: handle null names (#7)
Browse files Browse the repository at this point in the history
fix: Handle the edge catch where name can null while sorting

Co-authored-by: Emiliano Necciari <e.necciari@blogic.it>
  • Loading branch information
enecciari and enecciariatbl authored Dec 23, 2023
1 parent 470ac7f commit 52f82aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class BluetoothQuickConnect extends Extension {
_addDevicesToMenu(skipDevice = null) {
this._controller
.getDevices()
.sort((a, b) => a.name.localeCompare(b.name))
.sort((a, b) => a.name && a.name.localeCompare(b.name))
.forEach((device) => {
if (device.paired && device.get_object_path() !== skipDevice) {
this._addMenuItem(device);
Expand Down

0 comments on commit 52f82aa

Please sign in to comment.