diff --git a/src/serializer/BitSet.php b/src/serializer/BitSet.php index e093a7c6..785037ae 100644 --- a/src/serializer/BitSet.php +++ b/src/serializer/BitSet.php @@ -136,7 +136,7 @@ public function write(PacketSerializer $out, int $length = null) : void{ $nextShift = $currentShift + self::SHIFT; if($nextShift >= self::INT_BITS){ $nextShift -= self::INT_BITS; - $bits |= $parts[++$currentIndex] << (self::SHIFT - $nextShift); + $bits |= ($parts[++$currentIndex] ?? 0) << (self::SHIFT - $nextShift); } $currentShift = $nextShift;