luci-app-nlbwmon: fix nil value concat

Do not concatenate the yet undefined mtime variable to avoid a controller
error with backtrace.

Fixes: b3642f476 ("luci-app-nlbwmon: add proper file names for json and csv exports.")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-10-02 19:20:53 +02:00
parent a90001419e
commit fb859e602b

View file

@ -57,8 +57,6 @@ function action_data()
json = "application/json" json = "application/json"
} }
local filename = "data." .. mtype
local args = { } local args = { }
local mtype = http.formvalue("type") or "json" local mtype = http.formvalue("type") or "json"
local delim = http.formvalue("delim") or "," local delim = http.formvalue("delim") or ","
@ -94,7 +92,7 @@ function action_data()
end end
http.prepare_content(types[mtype]) http.prepare_content(types[mtype])
http.header("Content-Disposition", "attachment; filename=\"%s\"" % filename) http.header("Content-Disposition", "attachment; filename=\"data.%s\"" % mtype)
exec("/usr/sbin/nlbw", args, http.write) exec("/usr/sbin/nlbw", args, http.write)
end end