Skip to content

Commit

Permalink
Merge pull request #166 from ilaotan/master
Browse files Browse the repository at this point in the history
保证拿到的集合中没有null值
  • Loading branch information
alexxiyang authored Apr 15, 2023
2 parents c6daaa7 + 1a355b2 commit 8ef4ce5
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 8ef4ce5

Please sign in to comment.