[be/memory][xs]: micro fix for null fields.
This commit is contained in:
@@ -109,7 +109,12 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
|
|||||||
var foundmatch = false;
|
var foundmatch = false;
|
||||||
_.each(self.fields, function(field) {
|
_.each(self.fields, function(field) {
|
||||||
var value = rawdoc[field.id];
|
var value = rawdoc[field.id];
|
||||||
if (value !== null) { value = value.toString(); }
|
if (value !== null) {
|
||||||
|
value = value.toString();
|
||||||
|
} else {
|
||||||
|
// value can be null (apparently in some cases)
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
// TODO regexes?
|
// TODO regexes?
|
||||||
foundmatch = foundmatch || (value.toLowerCase() === term.toLowerCase());
|
foundmatch = foundmatch || (value.toLowerCase() === term.toLowerCase());
|
||||||
// TODO: early out (once we are true should break to spare unnecessary testing)
|
// TODO: early out (once we are true should break to spare unnecessary testing)
|
||||||
|
|||||||
Reference in New Issue
Block a user