fixed pouchdb unable to find the view throwing error
This commit is contained in:
parent
2e997c9c6d
commit
3f1b2d6d63
|
@ -20,8 +20,13 @@ exports.getView = async viewName => {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const viewDoc = await db.get(generateMemoryViewID(viewName))
|
const viewDoc = await db.get(generateMemoryViewID(viewName))
|
||||||
return viewDoc.view
|
return viewDoc.view
|
||||||
|
} catch (err) {
|
||||||
|
// if PouchDB doesn't found the view it will fall here
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue