AnimatedImplementation.js: Length of animations not checked, resulting in undefined object #17699
Labels
Bug
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Resolution: Locked
This issue was locked by the bot.
Resolution: PR Submitted
A pull request with a fix has been provided.
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Steps to Reproduce
(Write your steps here:)
Expected Behavior
The animation should work without issues.
Actual Behavior
See description.
Reproducible Demo
https://snack.expo.io/SkCRgwXrM
This post was first posted as an issue for ReactXP, where it was agreed that this is most likely a problem with React-Native.
In short, there seems to be a problem with react-native/Libraries/Animated/src/AnimatedImplementation.js at line 297, where it doesn't actually check that
current
is above the length ofanimations
, resulting in an undefined object.From
AnimatedImplementation.js
line 294-298Here is a screenshot from my app, where the
animations
-array is of length 2, while the variablecurrent
is beyond that point, at length 2.Further info from original issue. Note that code below is TypeScript, and from the original project. The code in the sample-app above should reproduce the same error.
Below I have attached the component-code, my package.json, and a screenshot of debugging.
The current code that reproduces the error:
Here is package.json:
After debugging, it seems that I might have found a possible bug, although I am not sure. It might very well be that I am doing something wrong here.
Here, it is checking the animations-array for the index 2, but its length is 2.
The text was updated successfully, but these errors were encountered: