diff options
Diffstat (limited to 'applications/luci-statistics/luasrc/statistics/datatree.lua')
-rw-r--r-- | applications/luci-statistics/luasrc/statistics/datatree.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/datatree.lua b/applications/luci-statistics/luasrc/statistics/datatree.lua index 957b230a96..82e7a281d5 100644 --- a/applications/luci-statistics/luasrc/statistics/datatree.lua +++ b/applications/luci-statistics/luasrc/statistics/datatree.lua @@ -123,11 +123,13 @@ function Instance.data_types( self, plugin, instance ) return rv end -function Instance.data_instances( self, plugin, instance, type ) +function Instance.data_instances( self, plugin, instance, dtype ) local rv = { } - for i, instance in ipairs( self._plugins[plugin][instance][type] ) do - table.insert( rv, instance ) + if type(self._plugins[plugin][instance][dtype]) == "table" then + for i, instance in ipairs( self._plugins[plugin][instance][dtype] ) do + table.insert( rv, instance ) + end end return rv |