Skip to content

Commit 54e9471

Browse files
Adam ComellaFacebook Github Bot
authored andcommitted
Navigator: null check on gesture.overswipe to prevent crash
Summary: Sometimes, `gesture.overswipe` can be `null`/`undefined` in `_moveAttachedGesture` resulting in a crash. This change adds a null check to avoid the crash. `_matchGestureAction` has a similar check so it looks like this case was overlooked in `_moveAttachedGesture`. **Test plan (required)** My team's app is using this change. Adam Comella Microsoft Corp. Closes #11017 Differential Revision: D4207277 Pulled By: ericvicenti fbshipit-source-id: a22817c2ebec1c996583269a59d6767f5713771b
1 parent dcbcda7 commit 54e9471

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/CustomComponents/Navigator/Navigator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ var Navigator = React.createClass({
914914
}
915915
return;
916916
}
917-
if (this._doesGestureOverswipe(this.state.activeGesture)) {
917+
if (gesture.overswipe && this._doesGestureOverswipe(this.state.activeGesture)) {
918918
var frictionConstant = gesture.overswipe.frictionConstant;
919919
var frictionByDistance = gesture.overswipe.frictionByDistance;
920920
var frictionRatio = 1 / ((frictionConstant) + (Math.abs(nextProgress) * frictionByDistance));

0 commit comments

Comments
 (0)