diff --git a/src/viewer.js b/src/viewer.js index d82a2d77..e37457af 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -245,6 +245,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";