From 02f79731a9f18a0e632d16fe856134f8ced62b59 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Mon, 25 Jul 2016 15:49:22 -0400 Subject: [PATCH] Fix UserSessionUtils#invalidateAllSessions with no active sessions --- .../java/net/frozenorb/apiv3/util/UserSessionUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/frozenorb/apiv3/util/UserSessionUtils.java b/src/main/java/net/frozenorb/apiv3/util/UserSessionUtils.java index c79bdd9..e9d537c 100644 --- a/src/main/java/net/frozenorb/apiv3/util/UserSessionUtils.java +++ b/src/main/java/net/frozenorb/apiv3/util/UserSessionUtils.java @@ -71,7 +71,14 @@ public class UserSessionUtils { return; } - redisClient.delMany((List) result.result().getList(), (result2) -> { + List sessions = (List) result.result().getList(); + + if (sessions.isEmpty()) { + callback.onResult(null, null); + return; + } + + redisClient.delMany(sessions, (result2) -> { if (result2.succeeded()) { callback.onResult(null, null); } else {