From 4cd428a726c46f5a56460e2ae5d7ac6f0a2cc5db Mon Sep 17 00:00:00 2001 From: Simon Ho Date: Thu, 30 Jul 2015 08:46:49 -0700 Subject: [PATCH] Fix regexp error for the memory connector - Check for undefined/null values when accessing `regexp` key --- lib/connectors/memory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/connectors/memory.js b/lib/connectors/memory.js index 2b18e0c4..8cb986e3 100644 --- a/lib/connectors/memory.js +++ b/lib/connectors/memory.js @@ -461,14 +461,14 @@ function applyFilter(filter) { return value.match(example); } - if (example.regexp) - return value.match(example.regexp); - if (example === undefined) { return undefined; } if (typeof example === 'object' && example !== null) { + if (example.regexp) + return value.match(example.regexp); + // ignore geo near filter if (example.near) { return true;