luci-app-dawn: Fix TypeError undef (reading '0')
authorSean Khan <datapronix@protonmail.com>
Tue, 2 Jul 2024 09:48:49 +0000 (05:48 -0400)
committerPaul Donald <newtwen+github@gmail.com>
Sat, 6 Jul 2024 12:41:33 +0000 (14:41 +0200)
Fixes error with hearing map showing:

```
Cannot read properties of undefined (reading '0')
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
applications/luci-app-dawn/htdocs/luci-static/resources/view/dawn/hearing_map.js

index 8b93fbfd6d09e54c4d507c1070bac5c22fe85df9..fdf840e4ba4011801a98ddddb6efe3c642bfd59c 100644 (file)
@@ -90,9 +90,11 @@ return view.extend({
                                                        ap[1].score
                                                ]
                                        }
+                                       return undefined;
                                })
                                
                        }).flat();
+                       clients = clients.filter(client => client !== undefined);
 
                        cbi_update_table(hearing_map_table, clients, E('em', _('No clients connected.')));