From a0c0486daba20fea15ad70fab439f9f6635f423b Mon Sep 17 00:00:00 2001 From: NGPixel Date: Tue, 6 Sep 2016 21:14:29 -0400 Subject: [PATCH] Fix empty search index error on Linux --- models/search.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/models/search.js b/models/search.js index e123527c..128a0f61 100644 --- a/models/search.js +++ b/models/search.js @@ -86,6 +86,17 @@ module.exports = { }; } + }).catch((err) => { + + if(err.type === 'NotFoundError') { + return { + match: [], + suggest: [] + }; + } else { + winston.error(err); + } + }); }, @@ -113,6 +124,14 @@ module.exports = { return true; } + }).catch((err) => { + + if(err.type === 'NotFoundError') { + return true; + } else { + winston.error(err); + } + }).then(() => { return self._si.addAsync({