1
0
Fork 0
mirror of synced 2024-09-11 15:08:05 +12:00

fixed pouchdb unable to find the view throwing error

This commit is contained in:
NEOLPAR 2022-08-10 13:11:10 +01:00
parent 5e53dd9b66
commit 720327b58f

View file

@ -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
}
}
}