Skip to content

Commit

Permalink
Don't observe without something to observe
Browse files Browse the repository at this point in the history
  • Loading branch information
simison authored and sirreal committed Dec 26, 2018
1 parent 271560b commit f60e1ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/gutenberg/extensions/tiled-gallery/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class TiledGalleryEdit extends Component {
// ResizeObserver has checks for `window` & `document`:
// it does nothing if those are not available.
this.observer = new ResizeObserver( this.onGalleryResize );
this.observer.observe( this.container.current ); //parentNode
if ( this.container.current ) {
this.observer.observe( this.container.current );
}
} );
}

Expand Down

0 comments on commit f60e1ae

Please sign in to comment.