Skip to content

Commit

Permalink
Fix NPE when updating leaderboards on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Oct 4, 2024
1 parent 5e87842 commit e9bc3db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void stun(Player player, User user, LivingEntity entity) {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private @NotNull AttributeModifier getAttributeModifier(AttributeInstance speed, double STUN_SPEED_REDUCTION) {
double reducedSpeed = speed.getValue() * STUN_SPEED_REDUCTION;
double attributeValue = -1 * reducedSpeed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ public List<UserState> loadStates(boolean ignoreOnline, boolean skipKeyValues) t
traitModifiers = Collections.emptyMap();
}

Map<Skill, Integer> skillLevelMap = loadedSkillLevels.get(userId);
Map<Skill, Double> skillXpMap = loadedSkillXp.get(userId);
Map<Skill, Integer> skillLevelMap = loadedSkillLevels.getOrDefault(userId, new HashMap<>());
Map<Skill, Double> skillXpMap = loadedSkillXp.getOrDefault(userId, new HashMap<>());

UserState state = new UserState(uuid, skillLevelMap, skillXpMap, statModifiers, traitModifiers, mana);
states.add(state);
Expand Down

0 comments on commit e9bc3db

Please sign in to comment.