Mod Menu: Fix empty list crash#6015
Merged
serprex merged 1 commit intoHarbourMasters:develop-copperfrom Jan 1, 2026
Merged
Conversation
Contributor
|
This does make sense, but I'd also like it to just not allow editing if the list is empty, since it just doesn't makes sense to edit an empty list in the first place. |
serprex
approved these changes
Jan 1, 2026
Malkierian
approved these changes
Jan 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes a minor crash in Copper Bravo (9.1.1).
Steps to reproduce:
modsfolder is empty.Video:
Cause:
When there are no mods installed,
CVAR_ENABLED_MODS_VALUEis an empty string. As such, line 99 evaluates to a list containing one empty string, i.e.{ "" }.When starting the game, line 169 removes any mods from this list that can’t be found in the filesystem (e.g. have been uninstalled), which incidentally removes the
""from the list.But when clicking Edit and then Cancel, line 99 is executed but line 169 is not. As a result, the
enabledModFilesvariable remains a list containing one empty string. Somewhere down the line when rendering the UI, this causes an out of range error.Fix:
If
CVAR_ENABLED_MODS_VALUEis an empty string, thenGetEnabledModsFromCVarshould just return an empty list. This seems most likely to be the “intended” behaviour; the removal logic on 169 was likely obscuring this error before.Build Artifacts