Skip to content

Commit abce5b5

Browse files
NPE Evading
1 parent 6a310a7 commit abce5b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/com/nisovin/magicspells/Spell.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,11 @@ protected void playSpellEffects(EffectPosition pos, Entity entity) {
19451945
if (canceler == null) continue;
19461946
if (!(entity instanceof Player)) continue;
19471947
Player p = (Player)entity;
1948-
this.callbacks.get(p.getUniqueId().toString()).get(pos).add(canceler);
1948+
Map<EffectPosition, List<Runnable>> runnablesMap = this.callbacks.get(p.getUniqueId().toString());
1949+
if (runnablesMap == null) continue;
1950+
List<Runnable> runnables = runnablesMap.get(pos);
1951+
if (runnables == null) continue;
1952+
runnables.add(canceler);
19491953
}
19501954
}
19511955
}

0 commit comments

Comments
 (0)