1.17 error - "java.util.List.iterator()" because "objects" is null
LoneDev6 opened this issue · 3 comments
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "objects" is null
at com.comphenix.protocol.wrappers.WrappedDataWatcher.<init>(WrappedDataWatcher.java:106) ~[?:?]
INVISIBLE_ARMORSTAND_PACKET = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
INVISIBLE_ARMORSTAND_PACKET.getModifier().writeDefaults();
INVISIBLE_ARMORSTAND_PACKET.getIntegers().write(0, ARMORSTAND_ID);
WrappedDataWatcher dataWatcher = new WrappedDataWatcher(INVISIBLE_ARMORSTAND_PACKET.getWatchableCollectionModifier().read(0)); // <--- error here, read(0) returns null.
This server is running CraftBukkit version 3159-Spigot-f773da8-887bc05 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
ProtocolLib version 4.7.0-SNAPSHOT-b520
That watchable collection is going to be null because you just created the packet. The error in the data watcher could probably stand to be more helpful, but that's more or less the expected behavior. You could create an empty data watcher instead, or one from the entity