Throw an NPE if a null delegate sender is passed to SenderFactory#wrap

This commit is contained in:
Luck 2017-07-26 10:10:25 +01:00
parent d9e5bc9345
commit e2f800dd63
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -27,6 +27,7 @@ package me.lucko.luckperms.common.commands.sender;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
@ -59,7 +60,7 @@ public abstract class SenderFactory<T> {
protected abstract boolean hasPermission(T t, String node); protected abstract boolean hasPermission(T t, String node);
public final Sender wrap(T t) { public final Sender wrap(@NonNull T sender) {
return new AbstractSender<>(plugin, this, t); return new AbstractSender<>(plugin, this, sender);
} }
} }