summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/dispatcher.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/dispatcher.lua')
-rw-r--r--src/ffluci/dispatcher.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ffluci/dispatcher.lua b/src/ffluci/dispatcher.lua
index ee836043d2..139b0e3083 100644
--- a/src/ffluci/dispatcher.lua
+++ b/src/ffluci/dispatcher.lua
@@ -172,7 +172,7 @@ function cbi(request)
i18n.loadc(request.module)
local stat, map = pcall(cbi.load, path)
- if stat then
+ if stat and map then
local stat, err = pcall(map.parse, map)
if not stat then
disp.error500(err)
@@ -181,6 +181,8 @@ function cbi(request)
tmpl.render("cbi/header")
map:render()
tmpl.render("cbi/footer")
+ elseif not stat then
+ disp.error500(map)
else
disp.error404()
end
@@ -208,7 +210,7 @@ function dynamic(request)
end
local stat, map = pcall(cbi.load, path)
- if stat then
+ if stat and map then
local stat, err = pcall(map.parse, map)
if not stat then
disp.error500(err)
@@ -218,6 +220,9 @@ function dynamic(request)
map:render()
tmpl.render("cbi/footer")
return
+ elseif not stat then
+ disp.error500(map)
+ return
end
disp.error404()