[backend/memory,bugfix][xs]: fix error on memory filtering when field value is null (cannot call toString).

This commit is contained in:
Rufus Pollock 2012-04-21 22:48:33 +01:00
parent 60b7f19f71
commit 92ec8d5b3e

View File

@ -158,7 +158,8 @@ this.recline.Backend = this.recline.Backend || {};
_.each(terms, function(term) {
var foundmatch = false;
dataset.fields.each(function(field) {
var value = rawdoc[field.id].toString();
var value = rawdoc[field.id];
if (value !== null) { value = value.toString(); }
// TODO regexes?
foundmatch = foundmatch || (value === term);
// TODO: early out (once we are true should break to spare unnecessary testing)