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<{
|
allowedExtensions: () => Promise<{
|
||||||
extensions: string[];
|
extensions: string[];
|
||||||
}>;
|
}>;
|
||||||
askFile: () => Promise<string[]>;
|
askFile: () => Promise<string[] | undefined>;
|
||||||
exit: () => Promise<void>;
|
exit: () => Promise<void>;
|
||||||
mergeAudio: (filename: string) => Promise<string>;
|
mergeAudio: (filename: string) => Promise<string>;
|
||||||
confirmation: (text: string) => Promise<void>;
|
confirmation: (text: string) => Promise<void>;
|
||||||
|
@ -22,7 +22,7 @@ const getFile = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = await internals.askFile();
|
const file = await internals.askFile();
|
||||||
if (file.length === 0) {
|
if (file === undefined || file.length === 0) {
|
||||||
await internals.exit();
|
await internals.exit();
|
||||||
}
|
}
|
||||||
return file.join("");
|
return file.join("");
|
||||||
|
|
Loading…
Reference in a new issue