From 45cb3777c496897927f147d2c8155b7c09c2b522 Mon Sep 17 00:00:00 2001 From: MagicJinn Date: Wed, 2 Aug 2023 21:09:07 +0200 Subject: [PATCH] added a check whether the json exists to prevent errors in the console --- mrbeastify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbeastify.js b/mrbeastify.js index b9fdf78..f04fb79 100644 --- a/mrbeastify.js +++ b/mrbeastify.js @@ -42,7 +42,7 @@ function applyOverlayToThumbnails() { const overlayImageIndex = getRandomImageFromDirectory(); let flip = Math.random() < 0.25; // 25% chance to flip the image let overlayImageURL - if (flip && flipBlacklist.includes(overlayImageIndex)) { + if (typeof flipBlacklist !== 'undefined' && flip && flipBlacklist.includes(overlayImageIndex)) { if (useAlternativeImages) { overlayImageURL = getImageURL(`textFlipped/${overlayImageIndex}`); flip = false;