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

CompoundTag/ListTag ArrayAccess writing non-NamedTag values silently fails on nonexisting offsets #32

Closed
dktapps opened this issue Feb 8, 2018 · 0 comments

Comments

@dktapps
Copy link
Member

dktapps commented Feb 8, 2018

		$tag = new CompoundTag();

		$tag["test"] = 5;
		var_dump($tag);

Output:

object(pocketmine\nbt\tag\CompoundTag)#12911 (2) {
  ["value":protected]=>
  array(0) {
  }
  ["__name":protected]=>
  string(0) ""
}

This should instead throw an exception instead of silently not working.

dktapps added a commit that referenced this issue Feb 9, 2018
we want to check if it's set, not try to read it for instanceof (which will crash).

This makes the behaviour consistent with CompoundTags (and also restores #32 for lists).
dktapps added a commit that referenced this issue Feb 12, 2018
we want to check if it's set, not try to read it for instanceof (which will crash).

This makes the behaviour consistent with CompoundTags (and also restores #32 for lists).
dktapps added a commit that referenced this issue Feb 12, 2018
we want to check if it's set, not try to read it for instanceof (which will crash).

This makes the behaviour consistent with CompoundTags (and also restores #32 for lists).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant