fixed pouchdb unable to find the view throwing error
This commit is contained in:
parent
5e53dd9b66
commit
720327b58f
1 changed files with 7 additions and 2 deletions
|
@ -20,8 +20,13 @@ exports.getView = async viewName => {
|
|||
return null
|
||||
}
|
||||
|
||||
const viewDoc = await db.get(generateMemoryViewID(viewName))
|
||||
return viewDoc.view
|
||||
try {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue