2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00

fix: prevent no such table error

This commit is contained in:
18alantom 2022-01-17 11:13:42 +05:30
parent dfd34f51f5
commit 5fc21ce291

View File

@ -319,7 +319,15 @@ module.exports = class Database extends Observable {
}
});
const values = await builder.select('fieldname', 'value', 'parent');
let values = [];
try {
values = await builder.select('fieldname', 'value', 'parent');
} catch (error) {
if (error.message.includes('no such table')) {
return [];
}
throw error;
}
return values.map((value) => {
const fields = frappe.getMeta(value.parent).fields;