diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java index e9860fd7..5899d5b0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java @@ -286,6 +286,9 @@ public void invoke(String... args) throws Exception { public User checkServer(Client client, String username, String serverID) throws IOException { User user = getUserByUsername(username); + if (user == null) { + return null; + } if (user.getUsername().equals(username) && user.getServerId().equals(serverID)) { return user; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java index 3c356547..cf88ddc2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java @@ -235,6 +235,9 @@ public PlayerProfile getPlayerProfile(Client client) { PlayerProfile playerProfile; if (client.useOAuth) { User user = client.getUser(); + if (user == null) { + return null; + } playerProfile = getPlayerProfile(client.auth, user); if (playerProfile != null) return playerProfile; } @@ -253,6 +256,9 @@ public PlayerProfile getPlayerProfile(AuthProviderPair pair, String username, Cl UUID uuid = null; if (pair.isUseCore()) { User user = pair.core.getUserByUsername(username); + if (user == null) { + return null; + } PlayerProfile playerProfile = getPlayerProfile(pair, user); uuid = user.getUUID(); if (playerProfile != null) return playerProfile; @@ -280,6 +286,9 @@ public PlayerProfile getPlayerProfile(AuthProviderPair pair, UUID uuid, ClientPr String username = null; if (pair.isUseCore()) { User user = pair.core.getUserByUUID(uuid); + if (user == null) { + return null; + } PlayerProfile playerProfile = getPlayerProfile(pair, user); username = user.getUsername(); if (playerProfile != null) return playerProfile;