Archiviert
13
0

It is an error to pass an empty type array.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-12-07 17:39:06 +01:00
Ursprung 54ef43fae8
Commit 4d11cfa8e8

Datei anzeigen

@ -391,6 +391,7 @@ public abstract class PacketAdapter implements PacketListener {
* @return Helper object.
*/
public static AdapterParameteters params(Plugin plugin, PacketType... packets) {
return new AdapterParameteters().plugin(plugin).types(packets);
}
@ -545,8 +546,10 @@ public abstract class PacketAdapter implements PacketListener {
this.connectionSide = ConnectionSide.add(this.connectionSide, type.getSender().toSide());
}
}
this.packets = Preconditions.checkNotNull(packets, "packets cannot be NULL");
if (packets.length == 0)
throw new IllegalArgumentException("Passed an empty packet type array.");
return this;
}