Fix NPE in Permissible#recalculatePermissions

This commit is contained in:
Luck 2019-12-13 14:30:37 +00:00
parent bd349ac4a3
commit 9093385de3
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 6 additions and 2 deletions

View File

@ -308,7 +308,9 @@ public class LPPermissible extends PermissibleBase {
// because we encapsulate op status within QueryOptions, we need to invalidate
// the contextmanager cache when op status changes.
// (#invalidate is a fast call)
this.queryOptionsSupplier.invalidate();
if (this.queryOptionsSupplier != null) { // this method is called by the super class constructor, before this class has fully initialised
this.queryOptionsSupplier.invalidate();
}
// but we don't need to do anything else in this method, unlike the CB impl.
}

View File

@ -294,7 +294,9 @@ public class LPPermissible extends PermissibleBase {
// because we encapsulate op status within QueryOptions, we need to invalidate
// the contextmanager cache when op status changes.
// (#invalidate is a fast call)
this.queryOptionsSupplier.invalidate();
if (this.queryOptionsSupplier != null) { // this method is called by the super class constructor, before this class has fully initialised
this.queryOptionsSupplier.invalidate();
}
// but we don't need to do anything else in this method, unlike the CB impl.
}