@ -24,8 +24,10 @@ exports.getView = async viewName => {
const viewDoc = await db.get(generateMemoryViewID(viewName))
return viewDoc.view
} catch (err) {
// if PouchDB doesn't found the view it will fall here
return null
// Return null when PouchDB doesn't found the view
if (err.status === 404) return null
throw err
}