diff --git a/javascript/OfflineDownloadTemplate.txt b/javascript/OfflineDownloadTemplate.txt index 55af2a5..1fa332d 100644 --- a/javascript/OfflineDownloadTemplate.txt +++ b/javascript/OfflineDownloadTemplate.txt @@ -410,6 +410,9 @@ function displayGui() { addBtn.innerHTML = "Add new"; addBtn.addEventListener("click", () => { var newMod = window.prompt("URL of Mod: ", "http://example.com/example.js"); + if (!newMod) { + return; //User pressed cancel + } Mods.push( newMod ); @@ -519,7 +522,7 @@ ${classes_js} setTimeout(() => { document.getElementById("launch_countdown_screen").remove(); main(); }, 50); } - +