From cc71c91bd7c746b9e496a7071fb07b469c7d3860 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Sat, 11 Oct 2025 23:03:28 +0200 Subject: [PATCH] prevent error when cancelling prompt --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 7d3012a..6e88ee7 100644 --- a/src/index.js +++ b/src/index.js @@ -124,6 +124,7 @@ runButton.onclick = () => { function downloadFile(content, extension, mime) { const filename = prompt("Filename?"); + if (filename === null) return; const blob = new Blob([content], { type: mime }); const url = URL.createObjectURL(blob);