From ed3b626cff5176fd1ed62aaa4b4b248864b79c01 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 18 Sep 2020 17:51:59 +0200 Subject: [PATCH] fix #3897 @0:15 --- js/libs/fluidbook/fluidbook.background.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.background.js b/js/libs/fluidbook/fluidbook.background.js index 3b8cb76d..21812aa8 100644 --- a/js/libs/fluidbook/fluidbook.background.js +++ b/js/libs/fluidbook/fluidbook.background.js @@ -19,11 +19,16 @@ FluidbookBackground.prototype = { if (Object.keys(this.fluidbook.settings.dynamicBackgroundColor).length > 0) { var $this = this; $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) { - var s = $this.fluidbook.settings.dynamicBackgroundColor[page]; - var back = s[0]; - var arrows = ''; - if (s.length > 1) { - arrows = s[1]; + try { + var s = $this.fluidbook.settings.dynamicBackgroundColor[page]; + var back = s[0]; + var arrows = ''; + if (s.length > 1) { + arrows = s[1]; + } + } catch (e) { + back = null; + arrows = ''; } var style; if (back === undefined || back === null || back === '' || back === '-') { @@ -62,7 +67,6 @@ FluidbookBackground.prototype = { left = (w - iw) / 2; } - if (this.fluidbook.settings.backgroundVAlign === Fluidbook.TOP) { top = 0 } else if (this.fluidbook.settings.backgroundVAlign === Fluidbook.BOTTOM) { -- 2.39.5