modules/admin-full: redirect back to overview page if trying to configure not existin...
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 25 Dec 2009 00:42:51 +0000 (00:42 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 25 Dec 2009 00:42:51 +0000 (00:42 +0000)
modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua

index 095e0efb979a885adca8cf92dd64b57fe1beb16f..d6abfd6ad171a59084f8ee08a63a1fa12c65f181 100644 (file)
@@ -44,7 +44,14 @@ nw.init(m.uci)
 ww.init(m.uci)
 
 local wnet = ww:get_network(arg[2])
-m.title = wnet and ww:get_i18n(wnet) or translate("Wireless Network")
+
+-- redirect to overview page if network does not exist anymore (e.g. after a revert)
+if not wnet then
+       luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
+       return
+end
+
+m.title = ww:get_i18n(wnet)
 
 
 local iw = nil