Skip to content

Commit

Permalink
保证拿到的集合中没有null值
Browse files Browse the repository at this point in the history
  • Loading branch information
ilaotan committed Apr 4, 2023
1 parent c6daaa7 commit 1a355b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/crazycake/shiro/RedisSessionDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ public Collection<Session> getActiveSessions() {
Set<byte[]> keys = redisManager.keys(keySerializer.serialize(this.keyPrefix + "*"));
if (keys != null && keys.size() > 0) {
for (byte[] key:keys) {
Session s = (Session) valueSerializer.deserialize(redisManager.get(key));
sessions.add(s);
Object deserialize = valueSerializer.deserialize(redisManager.get(key));
if (deserialize == null) {
continue;
}
sessions.add((Session) deserialize);
}
}
} catch (SerializationException e) {
Expand Down

0 comments on commit 1a355b2

Please sign in to comment.