Skip to content

Fix leaderboard access to prevent index errors using snapshots#13

Merged
CroaBeast merged 1 commit intomasterfrom
klema/leaderboards-exception
Mar 8, 2026
Merged

Fix leaderboard access to prevent index errors using snapshots#13
CroaBeast merged 1 commit intomasterfrom
klema/leaderboards-exception

Conversation

@Klema4
Copy link
Copy Markdown
Contributor

@Klema4 Klema4 commented Mar 6, 2026

This pull request makes a minor adjustment to the getTopPlayer method in BaseSystem.java to improve the safety and consistency of retrieving top player data.

  • Data consistency improvement: The method now creates a snapshot of the topTenPlayers list before accessing it, ensuring that the list does not change during the operation and preventing potential concurrency issues.

@Klema4 Klema4 requested a review from CroaBeast March 6, 2026 14:24
@Klema4 Klema4 self-assigned this Mar 6, 2026
@Klema4 Klema4 linked an issue Mar 6, 2026 that may be closed by this pull request
@Klema4 Klema4 marked this pull request as ready for review March 6, 2026 14:24
@CroaBeast CroaBeast merged commit ad1b7b6 into master Mar 8, 2026
@CroaBeast CroaBeast deleted the klema/leaderboards-exception branch March 8, 2026 21:01
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.

Leaderboard placeholders throw ArrayIndexOutOfBoundsException when empty

2 participants