From b6dc2f22e35a954bd0effa1154da132df61d202a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 29 Jul 2023 22:03:31 +0200 Subject: [PATCH] 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 (cherry picked from commit 00a941e618ecfb80dcccc5fd8e7d5d3eecb674b5) --- .../luci-static/resources/view/status/include/29_ports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), -- 2.30.2