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 коммит произвёл facebook-github-bot-6
Родитель 4dca06b238
Коммит c962251900
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

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