Преглед на файлове

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.
Matthias Schiffer преди 8 години
родител
ревизия
12f9df7e86
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua

+ 5 - 2
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