fix: #271 Cannot read properties of undefined (reading 'map')
This commit is contained in:
parent
1a33c493e4
commit
b6a58df463
@ -168,7 +168,7 @@ function getFinishedDownloadModels() {
|
||||
|
||||
const query = `SELECT * FROM models WHERE finish_download_at != -1 ORDER BY finish_download_at DESC`;
|
||||
db.all(query, (err: Error, row: any) => {
|
||||
res(row.map((item: any) => parseToProduct(item)));
|
||||
res(row?.map((item: any) => parseToProduct(item)) ?? []);
|
||||
});
|
||||
db.close();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user