Skip to content
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

Index out of Range Exception #2

Open
Knupper opened this issue May 22, 2018 · 1 comment
Open

Index out of Range Exception #2

Knupper opened this issue May 22, 2018 · 1 comment

Comments

@Knupper
Copy link

Knupper commented May 22, 2018

i change the code of "topTwoCards" and "bottomTwoCards" to the following, to make sure it is workiing for lists with 0 or 1 element as well.

List<SwipeCard> topTwoCards() => _cards.sublist( (_cards.length > 1) ? (_cards.length - 2) : 0, _cards.length);

@DanielEberl
Copy link

You are welcome to submit a pull request ! :)

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

No branches or pull requests

2 participants