Handle null causes by skipping them.

This commit is contained in:
sk89q 2014-07-24 17:38:18 -07:00
parent b4880ae982
commit acc39e11b1

View File

@ -80,6 +80,10 @@ public static boolean mayInvolvePlayer(List<? extends Cause<?>> causes) {
public static List<? extends Cause<?>> create(Object ... cause) {
List<Cause<?>> causes = new ArrayList<Cause<?>>(cause.length);
for (Object o : cause) {
if (o == null) {
continue;
}
if (o instanceof Player) {
causes.add(new PlayerCause((Player) o));
} else if (o instanceof Block) {