ZIP-lataus: null-tarkistus tiedostoille + virheilmoitus
Lisätty guard puuttuvalle projectFiles-datalle ja null-safe content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user