Skip to content

Commit

Permalink
ListTag: fixed incorrect exception type thrown when encountering a no…
Browse files Browse the repository at this point in the history
…n-empty list of TAG_End
  • Loading branch information
dktapps committed Dec 6, 2021
1 parent 0ae6548 commit f43db89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tag/ListTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace pocketmine\nbt\tag;

use pocketmine\nbt\NBT;
use pocketmine\nbt\NbtDataException;
use pocketmine\nbt\NbtStreamReader;
use pocketmine\nbt\NbtStreamWriter;
use pocketmine\nbt\ReaderTracker;
Expand Down Expand Up @@ -244,7 +245,7 @@ public static function read(NbtStreamReader $reader, ReaderTracker $tracker) : s

if($size > 0){
if($tagType === NBT::TAG_End){
throw new \UnexpectedValueException("Unexpected non-empty list of TAG_End");
throw new NbtDataException("Unexpected non-empty list of TAG_End");
}

$tracker->protectDepth(static function() use($size, $tagType, $reader, $tracker, &$value) : void{
Expand Down

0 comments on commit f43db89

Please sign in to comment.