From 060f36f47923c86a573eda85400ed55440df8f45 Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 09:46:34 +0300 Subject: [PATCH] ZIP-lataus: null-tarkistus tiedostoille + virheilmoitus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lisätty guard puuttuvalle projectFiles-datalle ja null-safe content. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index d242c40..71ca410 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2271,6 +2271,10 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, const card = document.getElementById(cardId); if (!card) return; const files = projectFiles[cardId]; + if (!files || Object.keys(files).length === 0) { + alert('Tiedostot eivät ole enää muistissa — aja pipeline uudelleen.'); + return; + } // CRC-32 laskenta ZIP-tiedostoille function crc32(bytes) { @@ -2291,7 +2295,7 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, for (const [name, content] of entries) { const nameBytes = new TextEncoder().encode(name); - const contentBytes = new TextEncoder().encode(content); + const contentBytes = new TextEncoder().encode(content || ''); const crc = crc32(contentBytes); // Local file header