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

[Minor] Ambiguous null/empty string representation #24

Open
Meems33 opened this issue May 6, 2014 · 2 comments
Open

[Minor] Ambiguous null/empty string representation #24

Meems33 opened this issue May 6, 2014 · 2 comments

Comments

@Meems33
Copy link

Meems33 commented May 6, 2014

Hi,

Something minor I noticed that I wasn't sure was intentional or not. The TagNodeString defaults the internal data value to "" and forces it to be "" when passed in through the constructor. The property however has no such guard meaning that the value can intentionally be set to null.

Is it valid for a TAG_STRING to have a null data value? I ask because it effects how Serialization/Deserialization of TagNodes behaves.

@Meems33
Copy link
Author

Meems33 commented May 11, 2014

Appendum: Similar questions apply to TagNodes that have internal object representations. The classes look like they assume that the data will never be null. Is that a safe assumption?

@jaquadro
Copy link
Member

It turns out that it's not a safe assumption. The writing logic is in https://github.com/jaquadro/Substrate/blob/master/SubstrateCS/Source/Nbt/NbtTree.cs and there's definitely no null check handling. It's an oversight.

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

No branches or pull requests

2 participants