summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-07-29 22:03:31 +0200
committerJo-Philipp Wich <jo@mein.io>2023-07-29 22:03:31 +0200
commit00a941e618ecfb80dcccc5fd8e7d5d3eecb674b5 (patch)
tree31014b27cc92770372207ef0a7c958cd096008bf /modules/luci-mod-status/htdocs
parentcb1529587f5b5a23ac2a8115a3b37ed7c3dacb11 (diff)
luci-mod-status: gracefully handle missing port stats
Ref: https://github.com/openwrt/luci/commit/cba58fcafbe3a3f4f599354f7c123b546e045887#commitcomment-123043170 Fixes: 4e46624817 ("luci-mod-status: introduce ethernet port status view") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-status/htdocs')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
index 31af6f460c..b226e4f3c6 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
@@ -217,7 +217,7 @@ function formatSpeed(speed, duplex) {
}
function formatStats(portdev) {
- var stats = portdev._devstate('stats');
+ var stats = portdev._devstate('stats') || {};
return ui.itemlist(E('span'), [
_('Received bytes'), '%1024mB'.format(stats.rx_bytes),