mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 10:51:51 +00:00
luci-mod-status: add null check
follow-up to 95b01600e3
Port maps can sometimes lack mappings. Let's check.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
@@ -350,14 +350,17 @@ function renderNetworksTooltip(pmap) {
|
||||
const res = [ null ];
|
||||
const zmap = {};
|
||||
|
||||
for (let pmz of pmap.zones) {
|
||||
const zones = (pmap && Array.isArray(pmap.zones)) ? pmap.zones : [];
|
||||
const networks = (pmap && Array.isArray(pmap.networks)) ? pmap.networks : [];
|
||||
|
||||
for (let pmz of zones) {
|
||||
const networknames = pmz.getNetworks();
|
||||
|
||||
for (let nn of networknames)
|
||||
zmap[nn] = pmz.getName();
|
||||
}
|
||||
|
||||
for (let pmn of pmap.networks)
|
||||
for (let pmn of networks)
|
||||
res.push(E('br'), renderNetworkBadge(pmn, zmap[pmn.getName()]));
|
||||
|
||||
if (res.length > 1)
|
||||
|
||||
Reference in New Issue
Block a user