diff --git a/src/Sticky.jsx b/src/Sticky.jsx index e4d40a11..c224929c 100644 --- a/src/Sticky.jsx +++ b/src/Sticky.jsx @@ -132,6 +132,10 @@ class Sticky extends Component { updateInitialDimension (options) { options = options || {} + if (!this.outerElement || !this.innerElement) { + return; + } + var outerRect = this.outerElement.getBoundingClientRect(); var innerRect = this.innerElement.getBoundingClientRect();