Fixed bug with Posion effect NPE (Something in champs is adding a null source).

Fixed bug with Tutorial cleanup.
This commit is contained in:
Jonathan Williams 2015-11-29 02:29:47 -06:00
parent 782026556e
commit 5b04a3223d
3 changed files with 6 additions and 4 deletions

View File

@ -489,8 +489,9 @@ public abstract class Tutorial implements ScoreboardElement, Listener
public void cleanup(Player player)
{
if (get(player).CurrentTask != null) get(player).CurrentTask.cleanup(player);
if (get(player) != null && get(player).CurrentTask != null)
get(player).CurrentTask.cleanup(player);
_inTutorial.remove(player.getName());
}
}

View File

@ -103,7 +103,8 @@ public class TutorialManager extends MiniPlugin
@EventHandler
public void quit(PlayerQuitEvent event)
{
if (!isInTutorial(event.getPlayer())) return;
if (!isInTutorial(event.getPlayer()))
return;
getTutorial(event.getPlayer()).cleanup(event.getPlayer());
}

View File

@ -374,7 +374,7 @@ public class ConditionEffect implements Listener
for (LivingEntity ent : Manager.GetActiveConditions().keySet())
{
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
if (condition == null)
if (condition == null || condition.GetSource() == null)
continue;
Manager.getDamagerManager().NewDamageEvent(ent, condition.GetSource(), null,