Skip to content

Commit

Permalink
fix: janhq#271 Cannot read properties of undefined (reading 'map')
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Oct 9, 2023
1 parent 1a33c49 commit b6a58df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion electron/core/plugins/data-plugin/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit b6a58df

Please sign in to comment.