luci-mod-network: fix potential null dereference on deleting VLANs
authorJo-Philipp Wich <jo@mein.io>
Sat, 20 Apr 2024 21:13:12 +0000 (23:13 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 20 Apr 2024 21:14:25 +0000 (23:14 +0200)
Fixes: #7074
Fixes: 61cef9baad ("luci-mod-network: don't trigger uci save on removing bridge vlans")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index 40ab9637b4e68f1a328be5b03734b0d96f8d3c69..09447cdf2b1e7e31041e5e7cfe9ac6e808e521e8 100644 (file)
@@ -921,7 +921,7 @@ return baseclass.extend({
 
                ss.handleRemove = function(section_id) {
                        this.map.data.remove('network', section_id);
-                       s.map.addedVLANs = s.map.addedVLANs.filter(function(sid) {
+                       s.map.addedVLANs = (s.map.addedVLANs || []).filter(function(sid) {
                                return sid != section_id;
                        });