a - #248
Conversation
<img width="399" height="174" alt="image" src="https://github.com/user-attachments/assets/9a9af6e1-1ea4-4010-8a46-edfbb71185e8" />
Resolves #37486 Original error log: ``` 2026-04-22 21:47:58 [error]: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') 2026-04-22 21:47:58 [error]: at System.Collections.Generic.List`1.get_Item(Int32 index) 2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.moveCardFocus(Int32 direction) 2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.OnKeyDown(KeyDownEvent e) ``` Currently, ```osu.Game\Screens\OnlinePlay\Matchmaking\RankedPlay\Hand\PlayerHandOfCards.cs::moveCardFocus``` does not account for the hand being empty (cards.Count ==0 ), and will attempt to move the card focus in the given direction regardless, which causes the above index out of range error. Added empty hand check to moveCardFocus, and a matching test case to TestScenePlayerCardHand.cs New test case before changes, recreating the error: <img width="986" height="232" alt="image" src="https://github.com/user-attachments/assets/daa62081-c776-44bd-b0d2-382b2dac7938" /> After: <img width="638" height="223" alt="image" src="https://github.com/user-attachments/assets/d6dcd8b8-8caf-42e3-9999-93dfe3fb6452" />
Based on internal feedback. I was going to apply other changes (like always posting to sentry) but don't want to go too far down a rabbit hole, so just fixed messaging a bit.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR introduces a test for empty card hand keyboard navigation, adds a safety guard against index errors in card hand focus logic, and improves localization and error messaging in matchmaking and score submission components across five files. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by Gitar
ScoreSubmissionto refine how submission errors are processed and logged.ScoreSubmissionto improve response to network or validation failures.This will update automatically on new commits.
Summary by CodeRabbit
Tests
Bug Fixes
Localization