Browse Source

Fixing a null pointer error related to skill cooldowns.

Glitchfinder 12 years ago
parent
commit
2c613d5b99
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/gmail/nossr50/util/Skills.java

+ 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
      */
     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)) {
             profile.setAbilityInformed(ability, true);
             player.sendMessage(ability.getAbilityRefresh());