From e1a16b4a9ff0c9b743483afc244205c783cbc293 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 11 Mar 2021 20:28:07 +0100 Subject: [PATCH] defensive check, #1736 --- src/routes/api/clipper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/api/clipper.js b/src/routes/api/clipper.js index 324b7c5bb..13b7a4496 100644 --- a/src/routes/api/clipper.js +++ b/src/routes/api/clipper.js @@ -106,7 +106,7 @@ function processContent(images, note, content) { for (const {src, dataUrl, imageId} of images) { const filename = path.basename(src); - if (!dataUrl.startsWith("data:image")) { + if (!dataUrl || !dataUrl.startsWith("data:image")) { log.info("Image could not be recognized as data URL:", dataUrl.substr(0, Math.min(100, dataUrl.length))); continue; }