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) {
|
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
|
||||||
|
|
Loading…
Reference in a new issue