Repository navigation
fix: null-guard enum choices in GameRulesetSchemaEntry (list-game-ruleset-schemas crash) - #194
Closed
sandsand244263 wants to merge 4 commits into
Closed
sandsand244263 wants to merge 4 commits into
sandsand244263 wants to merge 4 commits into
Conversation
lets pretend that this is a scalable design for flags in the first place. CN/KR players are gonna want global content :')
m_3FE1EA9E can be null on current builds, and m_default is a reference type; either throws NullReferenceException and aborts the whole list-game-ruleset-schemas dump. Falls back to an empty choice array.
Author
|
Understood — thanks for taking a look. I will keep it local on my side. Closing this to keep the tracker clean. |
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.
Fixes #193.
Problem
list-game-ruleset-schemasaborts with aNullReferenceExceptionon the current live build (CN2.25.0.0.154461N, DataToolv2.25.0.0+1151), so the custom-game setting schema cannot be dumped at all.list-game-rulesetsfails in the same model code.GameRulesetSchemaEntry.cs:38dereferences two reference-typed values without checking them:val2.m_3FE1EA9E(the enum choice array) is null for at least one entry on this build →.Select()throwsval2.m_defaultis ateStructuredDataAssetRef<STUIdentifier>reference type and can also be null → would throw one line earlierBecause the exception escapes from the
SelectinGameRulesetSchema.Init, the whole dump dies on the first malformed entry.Change
Null-conditional access with a safe fallback:
Plus
using System;forArray.Empty.No behaviour change for well-formed entries — the same data is produced when the fields are present.
Verification
On the same client that previously crashed:
→
ruleset_schemas.json, 125 schemas written, no exception.(
Array.Empty<T>()requiresSystem; added that using to the file.)