diff --git a/src/viewer.js b/src/viewer.js index 17c8184c..5e94285b 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -261,6 +261,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";