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 <brian@mainsequence.net> [fix commit subject, add commit description] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
e11ff51b17
commit
2221110c17
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
%>
|
||||
<tr class="tr">
|
||||
<td class="td"><%= (count_loop == 0) and mac or "" %></td>
|
||||
|
@ -56,6 +57,7 @@ function s.render(self, sid)
|
|||
count_loop = count_loop + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue