Fix filter data crashing when data contains non string values

It may happen when data comes from an import.

fix #1377
This commit is contained in:
Yohan Boniface 2023-10-26 16:54:43 +02:00
parent 45c1d1c419
commit 9434744219

View file

@ -478,8 +478,9 @@ L.U.FeatureMixin = {
matchFilter: function (filter, keys) { matchFilter: function (filter, keys) {
filter = filter.toLowerCase() filter = filter.toLowerCase()
for (let i = 0; i < keys.length; i++) { for (let i = 0, value; i < keys.length; i++) {
if ((this.properties[keys[i]] || '').toLowerCase().indexOf(filter) !== -1) value = (this.properties[keys[i]] || '') + ''
if (value.toLowerCase().indexOf(filter) !== -1)
return true return true
} }
return false return false