Skip to content

fix: allow null in writeString of serde emulator#443

Merged
LordMidas merged 1 commit into
developmentfrom
fix-writeString-exception
Mar 7, 2025
Merged

fix: allow null in writeString of serde emulator#443
LordMidas merged 1 commit into
developmentfrom
fix-writeString-exception

Conversation

@LordMidas

@LordMidas LordMidas commented Mar 6, 2025

Copy link
Copy Markdown
Member

When serializing a SerializationData, outside a regular save process of the game, the MetaData contains things such as Name, Filename etc. which are null but are stored in the SerializationEmulator with writeString. This does NOT throw any errors if the SerializationData is serialized during a regular game save cycle using the native _out object instead of a SerializationEmulator. However, with the emulator it throws an exception due to this requirement. In order to match the behavior of the vanilla native object, we should allow nulls.

This PR is on top of the other PR which fixes exceptions in the write integer cases: #412.

When serializing a SerializationData, outside a regular save process of the game, the MetaData contains things such as Name, Filename etc. which are null but are stored in the SerializationEmulator with `writeString`. This does NOT throw any errors if the  SerializationData is serialized during a regular game save cycle using the native `_out` object instead of a SerializationEmulator. However, with the emulator it throws an exception due to this requirement. In order to match the behavior of the vanilla native object, we should allow nulls.
@LordMidas LordMidas requested review from Enduriel and TaroEld March 6, 2025 17:32

@TaroEld TaroEld left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit ugly but oh well

@LordMidas LordMidas merged commit fb863ae into development Mar 7, 2025
@LordMidas LordMidas deleted the fix-writeString-exception branch March 7, 2025 02:01
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.

2 participants