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";