2
0
Эх сурвалжийг харах

Fixing a null pointer error related to skill cooldowns.

Glitchfinder 12 жил өмнө
parent
commit
2c613d5b99

+ 3 - 0
src/main/java/com/gmail/nossr50/util/Skills.java

@@ -80,6 +80,9 @@ public class Skills {
      * @param ability The ability to watch cooldowns for
      * @param ability The ability to watch cooldowns for
      */
      */
     public static void watchCooldown(Player player, PlayerProfile profile, AbilityType ability) {
     public static void watchCooldown(Player player, PlayerProfile profile, AbilityType ability) {
+        if(player == null || profile == null || ability == null)
+            return;
+
         if (!profile.getAbilityInformed(ability) && cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
         if (!profile.getAbilityInformed(ability) && cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
             profile.setAbilityInformed(ability, true);
             profile.setAbilityInformed(ability, true);
             player.sendMessage(ability.getAbilityRefresh());
             player.sendMessage(ability.getAbilityRefresh());