Summary
PR #152 review flagged a pre-existing debug-mode crash: the pinch debug path reads both touch entries without checking the actual native touch array length. I checked current master and PR #165 (thomas/pre-existing-fixes-v2), and both still have the same unguarded access.
Source review thread: #152 (comment)
Current code
Both origin/master and PR #165 still do:
const { touches } = gestureResponderEvent.nativeEvent;
setDebugPoints([
{
x: touches[0].pageX - originalPageX,
y: touches[0].pageY - originalPageY,
},
{
x: touches[1].pageX - originalPageX,
y: touches[1].pageY - originalPageY,
},
zoomCenter,
...points,
]);
Impact
This is limited to debug mode (debug={true}), but a gesture event where gestureState.numberActiveTouches === 2 while nativeEvent.touches.length < 2 can throw TypeError: Cannot read properties of undefined and terminate the gesture/debug session.
Suggested fix
Guard before reading touch entries:
if (touches.length < 2) return;
Then keep the existing setDebugPoints behavior for valid two-touch events.
Triage note
This is not covered by PR #165 or current master as of PR #152 HEAD 5fee673 / PR #165 HEAD c2796dc.
Summary
PR #152 review flagged a pre-existing debug-mode crash: the pinch debug path reads both touch entries without checking the actual native touch array length. I checked current
masterand PR #165 (thomas/pre-existing-fixes-v2), and both still have the same unguarded access.Source review thread: #152 (comment)
Current code
Both
origin/masterand PR #165 still do:Impact
This is limited to debug mode (
debug={true}), but a gesture event wheregestureState.numberActiveTouches === 2whilenativeEvent.touches.length < 2can throwTypeError: Cannot read properties of undefinedand terminate the gesture/debug session.Suggested fix
Guard before reading touch entries:
Then keep the existing
setDebugPointsbehavior for valid two-touch events.Triage note
This is not covered by PR #165 or current
masteras of PR #152 HEAD5fee673/ PR #165 HEADc2796dc.