minor codestyle fixes, addition of null check (#352)

This commit is contained in:
Egor Koleda 2020-01-10 01:20:32 +03:00 committed by Gravit
parent 9c487215d9
commit ee1d126539

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)));
} }
} }