Polish Optional usage
This commit is contained in:
committed by
Josh Cummings
parent
ffed4ea1dc
commit
e76de931ce
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -228,7 +228,7 @@ public class SwitchUserWebFilter implements WebFilter {
|
||||
@NonNull
|
||||
private Authentication attemptExitUser(Authentication currentAuthentication) {
|
||||
Optional<Authentication> sourceAuthentication = extractSourceAuthentication(currentAuthentication);
|
||||
if (!sourceAuthentication.isPresent()) {
|
||||
if (sourceAuthentication.isEmpty()) {
|
||||
this.logger.debug("Failed to find original user");
|
||||
throw noOriginalAuthenticationException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user