Merge pull request #1378 from umap-project/filter-with-non-str
Fix filter data crashing when data contains non string values
This commit is contained in:
commit
3fc5a63910
1 changed files with 3 additions and 2 deletions
|
@ -478,8 +478,9 @@ L.U.FeatureMixin = {
|
|||
|
||||
matchFilter: function (filter, keys) {
|
||||
filter = filter.toLowerCase()
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if ((this.properties[keys[i]] || '').toLowerCase().indexOf(filter) !== -1)
|
||||
for (let i = 0, value; i < keys.length; i++) {
|
||||
value = (this.properties[keys[i]] || '') + ''
|
||||
if (value.toLowerCase().indexOf(filter) !== -1)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue