Skip to content
Snippets Groups Projects
Commit 96c37ff5 authored by Philippe's avatar Philippe
Browse files

fix nil error and reformat text

parent 29499e1e
No related branches found
No related tags found
No related merge requests found
...@@ -18,10 +18,14 @@ end ...@@ -18,10 +18,14 @@ end
function M.handle(data) function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location") local sname = uci:get_first("gluon-node-info", "location")
if data._zip ~= nil then
uci:set("gluon-node-info", sname, "zip", data._zip:trim()) uci:set("gluon-node-info", sname, "zip", data._zip:trim())
else
uci:delete("gluon-node-info", sname, "zip")
end
uci:save("gluon-node-info") uci:save("gluon-node-info")
uci:commit("gluon-node-info") uci:commit("gluon-node-info")
end end
return M return M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment