From 2a8e9f2a635cd322a5c3b7a70df321cfcb2965a8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 30 Jul 2011 20:11:52 +0000 Subject: [PATCH] luci-0.10: prevent faults when no rdate info exists (#284) --- .../luasrc/model/cbi/freifunk/ffwizard.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua b/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua index 8a6e07836..621dd352a 100644 --- a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua +++ b/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua @@ -1048,13 +1048,15 @@ function main.write(self, section, value) -- Create time rdate_servers local rdate = uci:get_all("freifunk", "time") - uci:delete_all("system", "time") - uci:section("system", "time", "rdate_servers", rdate) - rdate.server = rdate.rdate_servers - rdate.rdate_servers = "" - uci:delete_all("system", "rdate", nil) - uci:section("system", "rdate", nil, rdate) - uci:save("system") + if rdate then + uci:delete_all("system", "time") + uci:section("system", "time", "rdate_servers", rdate) + rdate.server = rdate.rdate_servers + rdate.rdate_servers = "" + uci:delete_all("system", "rdate", nil) + uci:section("system", "rdate", nil, rdate) + uci:save("system") + end -- Delete old watchdog settings uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_watchdog.so.0.1"}) -- 2.25.1