You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enableLocalProfileCache is true, and the skin server provides an empty textures map for the player, the client crashes when joining a world (singleplayer or multiplayer).
According to the authlib-injector Yggdrasil server spec, skin servers can omit the skin or cape field of the textures object inside the base64-encoded textures profile property if the player does not have a skin or cape assigned. I don't know whether the MojangAPI implementation here cares about the authlib-injector spec, but it would be nice to be compatible :)
where a NullPointerException is thrown. localProfiles is a ConcurrentHashMap, which unlike a HashMapcannot have null keys or values. Given that this is the underlying problem, there's probably a simpler way to trigger this bug that doesn't involve an empty textures map.
Perhaps localProfiles could be changed to a Map<String, Optional<UserProfile>>?
1. Use Minecraft 1.20.6 (version probably doesn't matter) with CustomSkinLoader 14.22.2. Use a skin server that sends an empty `textures` object inside the base64-encoded textures profile property. Drasl will do this when a user doesn't have a skin.
3. Use the above CustomSkinLoader.json.
4. Join a world. The game will crash.
Describe the bug
When
enableLocalProfileCache
istrue
, and the skin server provides an emptytextures
map for the player, the client crashes when joining a world (singleplayer or multiplayer).According to the authlib-injector Yggdrasil server spec, skin servers can omit the
skin
orcape
field of thetextures
object inside the base64-encoded textures profile property if the player does not have a skin or cape assigned. I don't know whether the MojangAPI implementation here cares about the authlib-injector spec, but it would be nice to be compatible :)EDIT: According to https://minecraft.wiki/w/Mojang_API#Query_player's_skin_and_cape, the skin texture field "does not exist if the player does not have a custom skin". This might have been true at one point, but does not seem to be true now...
The crash happens at
Common/src/main/java/customskinloader/profile/ProfileCache.java
:MCCustomSkinLoader/Common/src/main/java/customskinloader/profile/ProfileCache.java
Line 92 in 5764d81
where a
NullPointerException
is thrown.localProfiles
is aConcurrentHashMap
, which unlike aHashMap
cannot have null keys or values. Given that this is the underlying problem, there's probably a simpler way to trigger this bug that doesn't involve an emptytextures
map.Perhaps
localProfiles
could be changed to aMap<String, Optional<UserProfile>>
?Here is a minimal reproducing configuration file:
Minimal config file
Steps to reproduce
Link to crash-report if applicable
https://mclo.gs/lUUFkLp
Link to CustomSkinLoader.log if applicable
https://mclo.gs/sNRbIp9
Link to latest.log if applicable
No response
[Only Forge User] Link to Forge Log if applicable
No response
Mod Version
14.22
Minecraft Version
1.20.6
Minecraft Launcher Name and Version
Fjord Launcher 9.2.1
Mod Loader
Fabric
Operating System
Linux
Before submitting a bug report
This bug wasn't already reported (I have searched bug reports on GitHub).
This is a valid bug (I am able to reproduce this on the latest dev build).
This problem is triggered in the latest version of the mod (if not the latest please upgrade the mod first)
The text was updated successfully, but these errors were encountered: