From c628f46591b4063f11771c80cea5acf768496f1d Mon Sep 17 00:00:00 2001 From: Edward Silverton Date: Tue, 14 Jul 2020 14:46:58 +0100 Subject: [PATCH] fix for OSD 'unload' before is has time to bootstrap --- src/viewer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/viewer.js b/src/viewer.js index b5b24318..f98b6182 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -240,6 +240,11 @@ $.Viewer = function( options ) { } this.element = this.element || document.getElementById( this.id ); + + if (!this.element) { + return; + } + this.canvas = $.makeNeutralElement( "div" ); this.canvas.className = "openseadragon-canvas";