Skip to content

Commit

Permalink
Merge pull request #77 from forforf/forforf-patch-contentWindow
Browse files Browse the repository at this point in the history
Add contentWindow check
  • Loading branch information
benhowell authored Apr 29, 2018
2 parents 89299e7 + 98a33ae commit 329ef7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class Gallery extends Component {
};
return (
<div id={this.props.id} className="ReactGridGallery" ref={(c) => this._gallery = c}>
<iframe style={resizeIframeStyles} ref={(c) => c && c.contentWindow.addEventListener('resize', this.onResize) } />
<iframe style={resizeIframeStyles} ref={(c) => c && c.contentWindow && c.contentWindow.addEventListener('resize', this.onResize) } />
{images}
<Lightbox
images={this.props.images}
Expand Down

0 comments on commit 329ef7b

Please sign in to comment.