luci-base: gracefully handle broken firewall forwarding sections
[project/luci.git] / modules / luci-base / luasrc / view / cbi / firewall_zoneforwards.htm
index 2a433b5..546fd8e 100644 (file)
         ⇒ 
        <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do
                fz = fwd:dest_zone()
-               empty = false %>
+               if fz then
+                       empty = false %>
                <label class="zonebadge" style="background-color:<%=fz:get_color()%>">
                        <strong><%=fz:name()%></strong>
                </label>&#160;
-       <% end %>
+       <% end end %>
        <% if empty then %>
                <label class="zonebadge zonebadge-empty">
                        <strong><%=zone:forward():upper()%></strong>