From aee051627b1284a7c19e4d1f1c821665103740e5 Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 28 Oct 2020 00:55:32 +0700 Subject: [PATCH] [FIX] NPE in SessionManager --- .../java/pro/gravit/launchserver/manangers/SessionManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/SessionManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/SessionManager.java index 163e41c4..8741344a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/SessionManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/SessionManager.java @@ -9,6 +9,7 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; @@ -44,7 +45,7 @@ private Client restoreFromString(String data) { result.daoObject = server.config.dao.userDAO.findByUsername(result.username); } } - + if(result.refCount == null) result.refCount = new AtomicInteger(1); return result; }