check for sticky ref before update

This commit is contained in:
Shawn Erquhart 2017-04-17 18:03:44 -04:00
parent c7d3de0fc8
commit 63e916ee2a

View File

@ -28,7 +28,7 @@ export class StickyContext extends Component {
}
updateStickies = (ref) => {
const stickyContextTop = ref.getBoundingClientRect().top;
const stickyContextTop = ref && ref.getBoundingClientRect().top;
this.subscriptions.forEach((fn) => { fn(stickyContextTop); });
};