mirror of
https://github.com/frappe/books.git
synced 2024-11-12 16:36:27 +00:00
fix: prevent no such table error
This commit is contained in:
parent
dfd34f51f5
commit
5fc21ce291
@ -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) => {
|
return values.map((value) => {
|
||||||
const fields = frappe.getMeta(value.parent).fields;
|
const fields = frappe.getMeta(value.parent).fields;
|
||||||
|
Loading…
Reference in New Issue
Block a user