minor codestyle fixes, addition of null check

This commit is contained in:
Egor Koleda 2020-01-10 01:00:02 +03:00 committed by GitHub
parent 081b86ff23
commit ab6d0af63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,12 +55,15 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception {
} else { } else {
pair = client.auth; pair = client.auth;
} }
if(pair == null) if (pair == null) {
{
sendError("ProfileByUUIDResponse: AuthProviderPair is null"); sendError("ProfileByUUIDResponse: AuthProviderPair is null");
return; return;
} }
username = pair.handler.uuidToUsername(uuid); username = pair.handler.uuidToUsername(uuid);
if (username == null) {
sendError(String.format("ProfileByUUIDResponse: User with uuid %s not found or AuthProvider#uuidToUsername returned null", uuid));
return;
}
sendResult(new ProfileByUUIDRequestEvent(getProfile(uuid, username, this.client, client.auth.textureProvider))); sendResult(new ProfileByUUIDRequestEvent(getProfile(uuid, username, this.client, client.auth.textureProvider)));
} }
} }