Browse Source

luci-mod-network: fix saving bridge VLANs without member ports

Calling `uci.set()` with an empty array yields an invalid argument error,
make sure to pass `null` instead in this case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Jo-Philipp Wich 3 years ago
parent
commit
f1f566bfe2

+ 1 - 1
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

@@ -304,7 +304,7 @@ var cbiTagValue = form.Value.extend({
 			}
 		}
 
-		uci.set('network', section_id, 'ports', ports);
+		uci.set('network', section_id, 'ports', ports.length ? ports : null);
 	},
 
 	remove: function() {}