mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-23 19:32:15 +00:00
fix: error handling when there are no results
This commit is contained in:
parent
99eeb0fbf5
commit
92c6b59a43
@ -32,7 +32,12 @@ export class DatabaseKeyExtractor {
|
||||
return null;
|
||||
}
|
||||
|
||||
const keys = db.exec('select file_path, ekey from `audio_file_ekey_table`')[0].values;
|
||||
const result = db.exec('select file_path, ekey from audio_file_ekey_table');
|
||||
if (result.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const keys = result[0].values;
|
||||
return keys.map(([path, ekey]) => ({
|
||||
// strip dir name
|
||||
name: getFileName(String(path)),
|
||||
|
Loading…
Reference in New Issue
Block a user