Skip to content

Commit

Permalink
Fix potential null packets
Browse files Browse the repository at this point in the history
  • Loading branch information
Estecka committed Oct 30, 2023
1 parent c827a4f commit a948aaf
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ else if (sendPacket instanceof ClientboundBundlePacket bundledPackets){
boolean doMutate = false;

for (var p : bundledPackets.subPackets()){
if (p instanceof ClientboundSetEntityDataPacket dataPacket && (p=TryMutatePacket(dataPacket)) != null)
if (p instanceof ClientboundSetEntityDataPacket dataPacket && (dataPacket=TryMutatePacket(dataPacket)) != null){
doMutate = true;
packets.add(p);
packets.add(dataPacket);
}
else
packets.add(p);
}

if (doMutate)
Expand Down

0 comments on commit a948aaf

Please sign in to comment.