From ee1d12653961318607d7874759105d0f2f451102 Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Fri, 10 Jan 2020 01:20:32 +0300 Subject: [PATCH] minor codestyle fixes, addition of null check (#352) --- .../socket/response/profile/ProfileByUUIDResponse.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java index 754196fb..5c211afc 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java @@ -55,12 +55,15 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { } else { pair = client.auth; } - if(pair == null) - { + if (pair == null) { sendError("ProfileByUUIDResponse: AuthProviderPair is null"); return; } 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))); } }