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

fix offline leaderboard crash #150

Merged
merged 6 commits into from
May 31, 2022
Merged

fix offline leaderboard crash #150

merged 6 commits into from
May 31, 2022

Conversation

panadax
Copy link
Collaborator

@panadax panadax commented May 27, 2022

I found the crash reason is, that in offline mode, we have an empty player list, and I want to access the player avatar of the top 3, which will be out of the boundary.

Copy link
Collaborator

@gaetschwartz gaetschwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should only display when there are more than 3, can't you only display like 1 or 2 when there are only that many ?

@panadax
Copy link
Collaborator Author

panadax commented May 28, 2022

Thanks for your comment.
I admit that I was not well-thought-out in solving this problem at that time, and now we can display the avatar of champions when the amount is less than 3.

Copy link
Collaborator

@gaetschwartz gaetschwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you use something,like this instead of using a separate var ?

for ((i, p) in championPlayers.withIndex()) {
   // logic here
}

@panadax
Copy link
Collaborator Author

panadax commented May 28, 2022

for ((i, p) in championPlayers.withIndex()) {
   // logic here
}

Yesss! Thanks for letting me know, it's more simplicity :)

Copy link
Collaborator

@bhvrgav bhvrgav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@panadax panadax merged commit 0cddcbb into main May 31, 2022
@panadax panadax deleted the fix_leaderboard_offline branch May 31, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for review This PR is waiting for review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants