fix(scroll-region): Handle edge case where React nodes are not available (Sentry 2763)

This commit is contained in:
Ben Gotow 2015-09-10 10:11:24 -07:00
parent 1a5dd2003f
commit ba00ad9cbe

View file

@ -50,6 +50,7 @@ class Scrollbar extends React.Component
_recomputeDimensions: ({avoidForcingLayout}) =>
if not avoidForcingLayout
trackNode = React.findDOMNode(@refs.track)
return unless trackNode
trackHeight = trackNode.clientHeight
if trackHeight isnt @state.trackHeight
@setState({trackHeight})
@ -282,8 +283,9 @@ class ScrollRegion extends React.Component
_recomputeDimensions: ({avoidForcingLayout}) =>
return unless @refs.content
contentNode = React.findDOMNode(@refs.content)
return unless contentNode
viewportScrollTop = contentNode.scrollTop
# While we're scrolling, calls to contentNode.scrollHeight / clientHeight