Fix type in some switch statements, add missing case #83763
Merged
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.
Summary
Bugfixes "Changes a couple switches to be the correct type (ter_str_id) and adds the missing null case"
Purpose of change
Fixes #83613
We were hitting the fallback in some switch cases, and that fallback didn't have a case present.
Also - the fallback was the wrong type, using f_null instead of t_null.
Describe the solution
Changed f_null to t_null
Added the missing t_null case, and mapped it to f_null
Describe alternatives you've considered
I thought about handling the null cases in the actual switch_source code - but the
"*_null": "*_null"is an existing pattern in the JSONs (for better, or worse).I do think this warrants a discussion on how to best handle these null cases. Should "fallback" be omitted if its just falling back to null, and null be an accepted default cause?
Testing
I loaded up the provided save file, and the issue is gone.
Additional context
As mentioned above, there are additional conversations to be had about how best to handle this in the future. I'm not sure this is the best place to make those changes though, as an existing pattern for handling them exists.