From 3642bc56c4402915601ecf306b9f9b27905ea14b Mon Sep 17 00:00:00 2001 From: Derek DesRochers Date: Sat, 20 Jul 2019 14:00:24 -0700 Subject: [PATCH] Update print.js Bug #354: Changed logic in print.js/loadIframeImage to prevent an infinite loop when an image is broken --- src/js/print.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/print.js b/src/js/print.js index 636eb17..b2b99a6 100644 --- a/src/js/print.js +++ b/src/js/print.js @@ -80,7 +80,7 @@ function loadIframeImages (images) { function loadIframeImage (image) { return new Promise(resolve => { const pollImage = () => { - !image || typeof image.naturalWidth === 'undefined' || image.naturalWidth === 0 || !image.complete + (!image || !image.complete) && (typeof image.naturalWidth === 'undefined' || image.naturalWidth === 0) ? setTimeout(pollImage, 500) : resolve() }