Substitute some !Optional.isPresent with Optional.isEmpty

This commit is contained in:
Ehren Kret
2021-02-10 10:18:59 -06:00
parent 28fe44aea4
commit ceda459942
2 changed files with 7 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ public class OptionalAccess {
}
//noinspection ConstantConditions
if (requestAccount.isPresent() && (!targetAccount.isPresent() || (targetAccount.isPresent() && !targetAccount.get().isEnabled()))) {
if (requestAccount.isPresent() && (targetAccount.isEmpty() || (targetAccount.isPresent() && !targetAccount.get().isEnabled()))) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}