Skip to content

Commit 33cefbf

Browse files
committed
Make sure observer exists before unobserving it
1 parent 54a3f43 commit 33cefbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/PlaceholderWithoutTracking.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class PlaceholderWithoutTracking extends React.Component {
5151
}
5252

5353
componentWillUnmount() {
54-
if (this.LAZY_LOAD_OBSERVER) {
54+
if (this.LAZY_LOAD_OBSERVER && this.LAZY_LOAD_OBSERVER.observer) {
5555
this.LAZY_LOAD_OBSERVER.observer.unobserve(this.placeholder);
5656
}
5757
}

0 commit comments

Comments
 (0)