Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Conversation

@SmusiJarviss
Copy link

Description

Describe the changes
Added handling for null scalar values when deserializing nullable Unity Vector2, Vector3, and Vector4 types from YAML configs.
This prevents exceptions when the YAML explicitly sets vector properties to null.
For non-nullable vectors, the deserializer behavior remains unchanged and will throw an error if null is provided.

What is the current behavior?
Currently, deserializing null for non-nullable vector properties causes unhandled exceptions. Nullable vectors are not properly handled when set to null in the YAML.
(https://discord.com/channels/656673194693885975/1375421848510271589)

What is the new behavior?
Nullable vectors can now safely accept null values from YAML, returning null without errors. Non-nullable vectors still throw an exception if assigned null.

Does this PR introduce a breaking change?
No. Existing non-nullable vector properties maintain their behavior. This change only improves nullable vector support and error handling.

Other information:


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

- Added handling of null scalars for nullable vector types.
- Prevents errors when YAML contains 'null' for vector properties.
- Maintains previous behavior for non-nullable vectors.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants