Skip to content

Commit f43db89

Browse files
committed
ListTag: fixed incorrect exception type thrown when encountering a non-empty list of TAG_End
1 parent 0ae6548 commit f43db89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tag/ListTag.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
namespace pocketmine\nbt\tag;
2525

2626
use pocketmine\nbt\NBT;
27+
use pocketmine\nbt\NbtDataException;
2728
use pocketmine\nbt\NbtStreamReader;
2829
use pocketmine\nbt\NbtStreamWriter;
2930
use pocketmine\nbt\ReaderTracker;
@@ -244,7 +245,7 @@ public static function read(NbtStreamReader $reader, ReaderTracker $tracker) : s
244245

245246
if($size > 0){
246247
if($tagType === NBT::TAG_End){
247-
throw new \UnexpectedValueException("Unexpected non-empty list of TAG_End");
248+
throw new NbtDataException("Unexpected non-empty list of TAG_End");
248249
}
249250

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

0 commit comments

Comments
 (0)