luci-mod-network: handle missing switch port state information
authorJo-Philipp Wich <jo@mein.io>
Tue, 28 Jan 2020 09:08:40 +0000 (10:08 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 28 Jan 2020 17:16:43 +0000 (18:16 +0100)
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 <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js

index c20665adf00dac1fa3ccc902df9f8d315a3cbfe3..4467238034cb8c6ef8060ed17652850ca8641023 100644 (file)
@@ -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'