Permalink
Browse files

_scaleImage function fix (search for "janpub" comment)

when gallery is externally rescalled e.g. on window resize event,
image might still be null what fired an exception.
  • Loading branch information...
janpub committed Oct 19, 2011
1 parent cd07497 commit fedd3bcf0e4e883b315f82a1fdab22ed0fec676d
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/galleria.js
View
@@ -3523,6 +3523,12 @@ this.prependChild( 'info', 'myElement' );
_scaleImage : function( image, options ) {
image = image || this._controls.getActive();
+
+ // janpub (JH) fix:
+ // image might be unselected yet
+ // e.g. when external logics rescales the gallery on window resize events
+ if(!image)
+ return;
var self = this,

0 comments on commit fedd3bc

Please sign in to comment.