Fix popstate event handler in WCF.ImageViewer
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 14 Oct 2016 16:36:55 +0000 (18:36 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 14 Oct 2016 16:36:55 +0000 (18:36 +0200)
wcfsetup/install/files/js/WCF.ImageViewer.js

index d97d3da4c18e47f208bc252accdb1ef2b036d85a..569d909349c2046aa414e3e386f6098faa891b9b 100644 (file)
@@ -318,7 +318,7 @@ $.widget('ui.wcfImageViewer', {
                this.element.click($.proxy(this.open, this));
 
                window.addEventListener('popstate', (function(event) {
-                       if (event.state.name === 'imageViewer') {
+                       if (event.state != null && event.state.name === 'imageViewer') {
                                if (event.state.container === this._eventNamespace) {
                                        this.open(event);
                                        this.showImage(event.state.image);