From 935cc3661224e8fc9ff88bf1b8e542b992b9cbb6 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sat, 4 Nov 2023 10:53:24 +0000 Subject: [PATCH] Return empty if image not found --- www/js/lib/images.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/js/lib/images.js b/www/js/lib/images.js index 59462824..f1e3f12d 100644 --- a/www/js/lib/images.js +++ b/www/js/lib/images.js @@ -109,6 +109,11 @@ function extractImages (images, callback) { // Zimit files store URLs encoded! if (params.zimType === 'zimit') title = encodeURI(title); appstate.selectedArchive.getDirEntryByPath(title).then(function (dirEntry) { + if (!dirEntry) { + console.warn('Could not find DirEntry for image: ' + title); + checkBatch(); + return; + } return appstate.selectedArchive.readBinaryFile(dirEntry, function (fileDirEntry, content) { image.style.background = ''; var mimetype = dirEntry.getMimetype();