Skip to content

Commit 82a97ab

Browse files
committed
bugfix(debug): SimpleCredentialsMatcher debug logs cause an NPE if turned on
1 parent 74563f9 commit 82a97ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/shiro/authc/credential/SimpleCredentialsMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected Object getCredentials(AuthenticationInfo info) {
9999
* @return {@code true} if the {@code tokenCredentials} are equal to the {@code accountCredentials}.
100100
*/
101101
protected boolean equals(Object tokenCredentials, Object accountCredentials) {
102-
if (LOGGER.isDebugEnabled()) {
102+
if (LOGGER.isDebugEnabled() && tokenCredentials != null) {
103103
LOGGER.debug("Performing credentials equality check for tokenCredentials of type ["
104104
+ tokenCredentials.getClass().getName() + " and accountCredentials of type ["
105105
+ accountCredentials.getClass().getName() + "]");

0 commit comments

Comments
 (0)