mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
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 https://github.com/facebook/react-native/pull/11017 Differential Revision: D4207277 Pulled By: ericvicenti fbshipit-source-id: a22817c2ebec1c996583269a59d6767f5713771b
This commit is contained in:
parent
dcbcda75ec
commit
54e947152f
@ -914,7 +914,7 @@ var Navigator = React.createClass({
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._doesGestureOverswipe(this.state.activeGesture)) {
|
if (gesture.overswipe && this._doesGestureOverswipe(this.state.activeGesture)) {
|
||||||
var frictionConstant = gesture.overswipe.frictionConstant;
|
var frictionConstant = gesture.overswipe.frictionConstant;
|
||||||
var frictionByDistance = gesture.overswipe.frictionByDistance;
|
var frictionByDistance = gesture.overswipe.frictionByDistance;
|
||||||
var frictionRatio = 1 / ((frictionConstant) + (Math.abs(nextProgress) * frictionByDistance));
|
var frictionRatio = 1 / ((frictionConstant) + (Math.abs(nextProgress) * frictionByDistance));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user