Skip to content

Conversation

@Kedar-27
Copy link

@Kedar-27 Kedar-27 commented Oct 6, 2020

When numberOfItems and index both are zero causes crash

When numberOfItems and index is zero
@benatautolist
Copy link

The original code seems correct to me, if you try to scroll to the 0th (first) element when there are no items in the array, then it should crash.

@Kedar-27
Copy link
Author

The original code seems correct to me, if you try to scroll to the 0th (first) element when there are no items in the array, then it should crash.

I agree, but when it is on automatic scroll and you remove items from the array, then it shouldn't crash.

@kennic
Copy link

kennic commented Oct 30, 2020

The original code seems correct to me, if you try to scroll to the 0th (first) element when there are no items in the array, then it should crash.

it should scroll to maximum index (or do nothing if empty item) instead, making it crash is a very bad idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants