X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-statistics%2Fluasrc%2Fstatistics%2Fdatatree.lua;fp=applications%2Fluci-statistics%2Fluasrc%2Fstatistics%2Fdatatree.lua;h=850b83a998c9bf33b53c0eca89c4cfadb0ef0b9e;hp=d6de6fa2178b08a15d526d41db6f81f31a2bfcb0;hb=bbc2c69965517c66b04d068cc9e8dab2c396efa4;hpb=ad7aecad88399b917b6a96952f3645c475e73c59 diff --git a/applications/luci-statistics/luasrc/statistics/datatree.lua b/applications/luci-statistics/luasrc/statistics/datatree.lua index d6de6fa21..850b83a99 100644 --- a/applications/luci-statistics/luasrc/statistics/datatree.lua +++ b/applications/luci-statistics/luasrc/statistics/datatree.lua @@ -196,10 +196,12 @@ end function Instance.host_instances( self ) local hosts_path = fs.glob(self._rrddir..'/*') local hosts = { } - k = 1 - for v in hosts_path do - hosts[k] = fs.basename(v) - k=k+1 + + if hosts_path then + local path + for path in hosts_path do + hosts[#hosts+1] = fs.basename(path) + end end return hosts