mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Fix error not being thrown
This commit is contained in:
parent
212e85c7b4
commit
899f8c1a82
1 changed files with 5 additions and 3 deletions
|
@ -139,13 +139,15 @@ class EJS_GameManager {
|
||||||
}
|
}
|
||||||
createCueFile(fileNames) {
|
createCueFile(fileNames) {
|
||||||
try {
|
try {
|
||||||
fileNames = fileNames.sort((a, b) => {
|
|
||||||
return (parseInt(a.charAt()[0]) > parseInt(b.charAt()[0])) ? 1 : -1;
|
|
||||||
})
|
|
||||||
fileNames = fileNames.filter((item) => {
|
fileNames = fileNames.filter((item) => {
|
||||||
return ["toc", "ccd", "exe", "pbp", "chd", "img", "bin"].includes(item.split(".").pop().toLowerCase());
|
return ["toc", "ccd", "exe", "pbp", "chd", "img", "bin"].includes(item.split(".").pop().toLowerCase());
|
||||||
})
|
})
|
||||||
|
fileNames = fileNames.sort((a, b) => {
|
||||||
|
if (isNaN(a.charAt()) || isNaN(b.charAt())) throw new Error("Incorrect file name format");
|
||||||
|
return (parseInt(a.charAt()) > parseInt(b.charAt())) ? 1 : -1;
|
||||||
|
})
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
console.log(fileNames);
|
||||||
if (fileNames.length > 1) {
|
if (fileNames.length > 1) {
|
||||||
console.warn("Could not auto-create cue file(s).");
|
console.warn("Could not auto-create cue file(s).");
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue