summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/dispatcher.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-03-28 22:55:27 +0000
committerSteven Barth <steven@midlink.org>2008-03-28 22:55:27 +0000
commitbd32a8aac5de9beb321b3cdfe180a8798c5a3379 (patch)
treea0b5e2926066e23c7356122a8afeb0ed0ef0e505 /src/ffluci/dispatcher.lua
parentfb2a9a328d619ecf329e64cb500ff1385e3f8290 (diff)
* CBI: improvements, bug fixes
* admin: Introduced wifi, olsr, password pages
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()