Skip to content

Commit 5e94df2

Browse files
committed
Polish Details Copy
1 parent f814dc0 commit 5e94df2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/java/org/springframework/security/authentication/ProviderManager.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,13 @@ private void prepareException(AuthenticationException ex, Authentication auth) {
278278
* @param dest the destination authentication object
279279
*/
280280
private Authentication copyDetails(Authentication source, Authentication dest) {
281-
return (dest.getDetails() != null) ? dest : dest.toBuilder().details(source.getDetails()).build();
281+
if (source.getDetails() == null) {
282+
return dest;
283+
}
284+
if (dest.getDetails() != null) {
285+
return dest;
286+
}
287+
return dest.toBuilder().details(source.getDetails()).build();
282288
}
283289

284290
public List<AuthenticationProvider> getProviders() {

0 commit comments

Comments
 (0)