Skip to content

Fallback OptionShowPlayerNames to 'on' when it is nil#6987

Merged
lL1l1 merged 2 commits intoFAForever:developfrom
Gatsik:patch-2
Feb 13, 2026
Merged

Fallback OptionShowPlayerNames to 'on' when it is nil#6987
lL1l1 merged 2 commits intoFAForever:developfrom
Gatsik:patch-2

Conversation

@Gatsik
Copy link
Contributor

@Gatsik Gatsik commented Dec 20, 2025

Fallback OptionShowPlayerNames to 'on' when it is nil, because game crashes when there are no options in game.prefs file
Most of the time (always?) GetFromCurrentProfile is checked for nil, but here this safety check was forgotten

Summary by CodeRabbit

  • Bug Fixes
    • Ensures player names in the armies table are shown by default when profile settings are missing, preventing startup crashes and keeping player info consistently visible.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a nil-check and fallback default ('on') for the OptionShowPlayerNames profile setting in the armies table UI and adds a changelog snippet documenting a startup crash fix when that option is missing.

Changes

Cohort / File(s) Summary
UI player name option fallback
lua/ui/override/ArmiesTable.lua
Adds a fallback default ('on') when reading OptionShowPlayerNames from the user profile to avoid nil values and ensure consistent behavior.
Changelog
changelog/snippets/fix.6987.md
Adds a changelog entry documenting the fix preventing a startup crash when the "Show Player Names" option is absent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

Poem

🐰 A nil no longer hides,
I hop in with a cheer,
Default 'on' now guides,
Names appear, loud and clear,
Hooray for fewer fear! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the reason for the change (game crash) and context (missing safety check), but lacks testing details and changelog documentation required by the template. Add a 'Testing done' section describing how the fix was tested and include a changelog snippet following the repository guidelines.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a fallback default for OptionShowPlayerNames to 'on' when nil.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lL1l1 lL1l1 merged commit 5ccf2a0 into FAForever:develop Feb 13, 2026
3 of 4 checks passed
relent0r pushed a commit to relent0r/fa that referenced this pull request Feb 23, 2026
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