handle the undefined behaviour
This commit is contained in:
parent
45235e63ce
commit
1853388ee6
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ let internals: {
|
|||
allowedExtensions: () => Promise<{
|
||||
extensions: string[];
|
||||
}>;
|
||||
askFile: () => Promise<string[]>;
|
||||
askFile: () => Promise<string[] | undefined>;
|
||||
exit: () => Promise<void>;
|
||||
mergeAudio: (filename: string) => Promise<string>;
|
||||
confirmation: (text: string) => Promise<void>;
|
||||
|
@ -22,7 +22,7 @@ const getFile = async () => {
|
|||
}
|
||||
|
||||
const file = await internals.askFile();
|
||||
if (file.length === 0) {
|
||||
if (file === undefined || file.length === 0) {
|
||||
await internals.exit();
|
||||
}
|
||||
return file.join("");
|
||||
|
|
Loading…
Reference in a new issue