Fix console spam when server sends a broken texture profile.

This commit is contained in:
Matthew Messinger 2018-08-26 18:31:02 -04:00
parent 91f741fa08
commit 1dc22f4ed4

View file

@ -124,6 +124,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
}
public CompletableFuture<Map<Type, MinecraftProfileTexture>> loadProfileTextures(GameProfile profile) {
try {
// try to recreate a broken gameprofile
// happens when server sends a random profile with skin and displayname
Property textures = Iterables.getFirst(profile.getProperties().get("textures"), null);
@ -145,6 +146,13 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
}
}
}
} catch (Exception e) {
if (profile.getId() == null) {
// Something broke server-side probably
logger.warn("{} had a null UUID and was unable to recreate it from texture profile.", profile.getName(), e);
return CompletableFuture.completedFuture(Collections.emptyMap());
}
}
return skins.getUnchecked(profile);
}