luci-mod-network: fix potential null dereference on deleting VLANs
[project/luci.git] / 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;
                        });