From 47d05fcac1626eae067ede078887dfbb55515c3c Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sat, 15 Jun 2019 16:18:37 +0100 Subject: [PATCH] Prevent exception on resize Former-commit-id: dc16e593b40cc01078616638d5c21b99894cd03e [formerly 05832a9874b0154183f7ac9919f3eb3ea23a6b43] Former-commit-id: 561a3194705ff28afc571d8fdf7fed4e4310a0f5 --- www/js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/js/app.js b/www/js/app.js index 448462d5..b7856979 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -100,7 +100,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'images', 'cookies', 'q', 'trans $(window).resize(function() { resizeIFrame; // We need to load any images exposed by the resize - document.getElementById('articleContent').contentWindow.onscroll(); + var scrollFunc = document.getElementById('articleContent').contentWindow; + scrollFunc = scrollFunc ? scrollFunc.onscroll : null; + if (scrollFunc) scrollFunc(); }); ////Polyfill scrollStopped event