From bd32a8aac5de9beb321b3cdfe180a8798c5a3379 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 28 Mar 2008 22:55:27 +0000 Subject: * CBI: improvements, bug fixes * admin: Introduced wifi, olsr, password pages --- src/ffluci/dispatcher.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ffluci/dispatcher.lua') 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() -- cgit v1.2.3