))
newnet:depends("_attach", "")
-newnet.default = "net_" .. arg[1]:gsub("[^%w_]+", "_")
+newnet.default = arg[1] and "net_" .. arg[1]:gsub("[^%w_]+", "_")
addnet = m:field(Value, "_netname_attach",
translate("Network to attach interface to"))
fwzone.template = "cbi/firewall_zonelist"
addnet.widget = "radio"
fwzone:depends("_attach", "")
-fwzone.default = "zone_" .. arg[1]:gsub("[^%w_]+", "_")
+fwzone.default = arg[1] and "zone_" .. arg[1]:gsub("[^%w_]+", "_")
function attachnet.write(self, section, value)