Fix crash when touch terminates without active gesture

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
This commit is contained in:
Eric Vicenti 2015-09-15 12:28:19 -07:00 committed by facebook-github-bot-6
parent 4dca06b238
commit c962251900
1 changed files with 3 additions and 0 deletions

View File

@ -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;