mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] AuthManager NPE
This commit is contained in:
parent
9e7dedffc9
commit
f0ae4cbb12
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue