Skip to content

Commit

Permalink
add check for String
Browse files Browse the repository at this point in the history
  • Loading branch information
theo committed Jan 30, 2019
1 parent 17c80fc commit 24f5d85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/crazycake/shiro/RedisCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ private String getStringRedisKey(K key) {

private String getRedisKeyFromPrincipalIdField(PrincipalCollection key) {
Object principalObject = key.getPrimaryPrincipal();

if (principalObject instanceof String) {
return principalObject.toString();
}
Method pincipalIdGetter = getPrincipalIdGetter(principalObject);
return getIdObj(principalObject, pincipalIdGetter);
}
Expand Down

0 comments on commit 24f5d85

Please sign in to comment.