From 84e23d96b47948e24ce17b79ab46a77cdedf9c2e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 28 Jan 2020 10:08:40 +0100 Subject: [PATCH] luci-mod-network: handle missing switch port state information Ref: https://github.com/openwrt/luci/issues/3565 Ref: https://forum.openwrt.org/t/cannot-read-property-link/50766 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 616d44c155ae2b4f19e8b2645744a107e38a56c7) --- .../htdocs/luci-static/resources/view/network/switch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js index 80c8437fc..47a67d5f5 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js @@ -66,7 +66,7 @@ function render_port_status(node, portstate) { if (!node) return null; - if (!portstate.link) + if (!portstate || !portstate.link) L.dom.content(node, [ E('img', { src: L.resource('icons/port_down.png') }), E('br'), @@ -146,7 +146,7 @@ return L.view.extend({ if (!topology) { ui.addNotification(null, _('Switch %q has an unknown topology - the VLAN settings might not be accurate.').replace(/%q/, switch_name)); - topology = { + topologies[switch_name] = topology = { features: {}, netdevs: { 5: 'eth0' -- 2.25.1