luci-mod-network: fix saving bridge VLANs without member ports
authorJo-Philipp Wich <jo@mein.io>
Fri, 2 Jul 2021 18:47:11 +0000 (20:47 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 2 Jul 2021 18:47:11 +0000 (20:47 +0200)
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>
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index d13299777f5801043a3593c07f9283fe96144f4f..6248f7bf77ce6c2356b31659a04a0b70733956b9 100644 (file)
@@ -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() {}