applications/luci-statistics: cope with rules having no target in iptables plugin...
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 22 Aug 2011 20:52:31 +0000 (20:52 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 22 Aug 2011 20:52:31 +0000 (20:52 +0000)
applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua

index f353d8b5335f4b2e83e961c075230814ba9f089c..1f7341c46ecbfd0d5cfcee24d696651f38dbbe61 100644 (file)
@@ -20,8 +20,10 @@ chains  = { }
 targets = { }
 
 for i, rule in ipairs( ip:find() ) do 
-       chains[rule.chain] = true
-       targets[rule.target] = true
+       if rule.chain and rule.target then
+               chains[rule.chain] = true
+               targets[rule.target] = true
+       end
 end