mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-04 14:31:45 +01:00
Prevent NPE when creating a Team without any entity
This commit is contained in:
parent
f13646fd0d
commit
f2f9cbc5fa
@ -80,7 +80,11 @@ public class TeamsPacket implements ServerPacket {
|
||||
}
|
||||
|
||||
if (action == Action.CREATE_TEAM || action == Action.ADD_PLAYERS_TEAM || action == Action.REMOVE_PLAYERS_TEAM) {
|
||||
writer.writeStringArray(entities);
|
||||
if (entities == null || entities.length == 0) {
|
||||
writer.writeVarInt(0); // Empty
|
||||
} else {
|
||||
writer.writeStringArray(entities);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user