Skip to content

Commit

Permalink
Fix crash when touch terminates without active gesture
Browse files Browse the repository at this point in the history
Summary: When the touch gets terminated, it is not guaranteed that there is an active gesture. It looks like this was causing crashes

@​public

Reviewed By: @​chaceliang

Differential Revision: D2441469
  • Loading branch information
Eric Vicenti authored and facebook-github-bot-6 committed Sep 15, 2015
1 parent 4dca06b commit c962251
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,9 @@ var Navigator = React.createClass({
},

_handlePanResponderTerminate: function(e, gestureState) {
if (this.state.activeGesture == null) {
return;
}
var destIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture);
this._detachGesture();
var transitionBackToPresentedIndex = this.state.presentedIndex;
Expand Down

0 comments on commit c962251

Please sign in to comment.