From 2221110c17c2799948209463590618190cce8808 Mon Sep 17 00:00:00 2001 From: BCoverstone Date: Mon, 9 Jan 2023 22:28:28 -0500 Subject: [PATCH] luci-app-dawn: fix crash issue when viewing hearing map When viewing the hearing map, sometimes a crash will happen when one of the routers suddenly cannot view a client. This PR simply checks that the radio frequency in data2 is not 0, and skips the entry if it is a 0. Submitted-by: Brian Coverstone [fix commit subject, add commit description] Signed-off-by: Jo-Philipp Wich --- .../luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua index d277865503..3ba5329855 100644 --- a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua +++ b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua @@ -38,6 +38,7 @@ function s.render(self, sid) local mac2, data2 local count_loop = 0 for mac2, data2 in pairs(data) do + if data2.freq ~= 0 then --prevent empty entry crashes %> <%= (count_loop == 0) and mac or "" %> @@ -53,7 +54,8 @@ function s.render(self, sid) <%= "%d" % data2.score %> <% - count_loop = count_loop + 1 + count_loop = count_loop + 1 + end end end %> -- 2.30.2