-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for out of bound reads #523
Conversation
This also gets rid of the dataLength variable
src/FlashList.tsx
Outdated
if (trailingItem === undefined) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry fora yet-another change, I always find some small improvement 😄
This check should no longer be necessary since we ensure in the previous if
that trailingItem
exists
if (trailingItem === undefined) { | |
return null; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Also fixed!
Description
When using a MobX store for the data a warning will be triggered from MobX about
out of bounds read (index)
. This is because the length of the array is not checked before accessing.This patch checks the length of the array before reading the value by index.
Checklist