Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling of empty list tags #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarkusPalcer
Copy link

Empty list tags save the child type as "0" which is a tag-type that class_from_type cannot map.

If the list is empty, the child-tag-type doesn't matter anyhow, so we can exit early without handling anything children related.

This issue appeared when trying to use CraftBook::NBT::Tag.from_hash tag.to_h to deep-clone an existing NBT-tag after reading a schematic file created by the Minecraft mod Structurize

Empty list tags save the child type as "0" which is a tag-type that `class_from_type` cannot map.

If the list is empty, the child-tag-type doesn't matter anyhow, so we can exit early without handling anything children related.

This issue appeared when trying to use `CraftBook::NBT::Tag.from_hash tag.to_h` to deep-clone an existing NBT-tag after reading a schematic file created by the Minecraft mod Structurize
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.

1 participant