Skip to content

Commit

Permalink
Hotfix for NPE in spectator emulation
Browse files Browse the repository at this point in the history
Fixed #462
  • Loading branch information
FlorianMichael committed Oct 30, 2023
1 parent d8b3666 commit ab4b927
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void register() {
Item[] equipment = new Item[4];
if (gameMode == 3) {
GameProfileStorage.GameProfile profile = wrapper.user().get(GameProfileStorage.class).get(myId);
equipment[3] = profile.getSkull();
equipment[3] = profile == null ? null : profile.getSkull();
} else {
for (int i = 0; i < equipment.length; i++) {
equipment[i] = playerSession.getPlayerEquipment(myId, i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public GameProfile put(UUID uuid, String name) {
return gameProfile;
}

public void putProperty(UUID uuid, Property property) {
properties.computeIfAbsent(uuid, profile -> new GameProfile(uuid, null)).properties.add(property);
}

public void putProperty(UUID uuid, String name, String value, String signature) {
putProperty(uuid, new Property(name, value, signature));
}

public GameProfile get(UUID uuid) {
return properties.get(uuid);
}
Expand Down

0 comments on commit ab4b927

Please sign in to comment.