Safer comparation between filters

This commit is contained in:
Jesús Ángel González 2018-04-18 16:17:43 +02:00
parent a831ef7bbd
commit 30387577a6

View File

@ -952,9 +952,15 @@ function discoverController(
}
const cleaned = [];
for(const filter of implicitFilter){
const tmp = queryFilter.getFilters().filter(item => item.meta.params.query === filter.meta.params.query &&
item.meta.params.type === filter.meta.params.type &&
item.meta.key === filter.meta.key );
const tmp = queryFilter
.getFilters()
.filter(item =>
item.meta && item.meta.params && item.meta.params.query &&
filter.meta && filter.meta.params && filter.meta.params.query &&
item.meta.params.query === filter.meta.params.query &&
item.meta.params.type === filter.meta.params.type &&
item.meta.key === filter.meta.key
);
if(!tmp.length) cleaned.push(filter);
}