mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-16 13:21:32 +01:00
Fix TristateResult NPE
This commit is contained in:
parent
419d711fb6
commit
d319d8dc52
@ -134,11 +134,17 @@ public final class TristateResult implements Result<Tristate, Node> {
|
||||
}
|
||||
}
|
||||
|
||||
public TristateResult result(@NonNull Node node) {
|
||||
public TristateResult result(@Nullable Node node) {
|
||||
if (node == null) {
|
||||
return UNDEFINED;
|
||||
}
|
||||
return new TristateResult(Tristate.of(node.getValue()), node, this.processorClass);
|
||||
}
|
||||
|
||||
public TristateResult resultWithOverride(@NonNull Node node, Tristate result) {
|
||||
public TristateResult resultWithOverride(@Nullable Node node, @NonNull Tristate result) {
|
||||
if (result == Tristate.UNDEFINED) {
|
||||
return UNDEFINED;
|
||||
}
|
||||
return new TristateResult(result, node, this.processorClass);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user