Skip to content

Commit e4ab2d8

Browse files
Update query
1 parent fec48e2 commit e4ab2d8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

query.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@
8585
},
8686

8787
query: function (rows, constraints, getter) {
88+
if (!Array.isArray(rows)) return []
8889
if (typeof getter == 'string') {
8990
var method = getter;
9091
getter = function (obj, key) {
9192
return obj[method](key);
9293
};
9394
}
9495
var filter = new Query.Query(constraints, getter);
95-
return (rows||[]).filter(filter);
96+
return rows.filter(filter);
9697
},
9798

9899
lhs: { // queries that are not yet referenced to a particular attribute, e.g. {$not: {likes: 0}}

0 commit comments

Comments
 (0)