From 12f9df7e866d8ebfab4e09694eaa1447c91f02c7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Oct 2015 21:19:28 +0200 Subject: [PATCH] gluon-config-mode-core: don't throw error when no config mode modules are installed The expert mode can still be useful without any cohfig mode modules. --- .../lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua index dda5e58c..569dd60e 100644 --- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua +++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua @@ -6,9 +6,12 @@ local util = require "nixio.util" local f, s local wizard = {} -local files = util.consume(fs.dir(wizard_dir)) +local files = {} -table.sort(files) +if fs.access(wizard_dir) then + files = util.consume(fs.dir(wizard_dir)) + table.sort(files) +end for _, entry in ipairs(files) do if entry:sub(1, 1) ~= '.' then