Ver código fonte

Fix NPE while store pet effects

Reported by: Attila
Zealar 9 anos atrás
pai
commit
8b7ac95f56

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/data/sql/impl/SummonEffectsTable.java

@@ -130,7 +130,7 @@ public class SummonEffectsTable
 	
 	public void addPetEffect(int controlObjectId, Skill skill, int effectCurTime)
 	{
-		_petEffects.putIfAbsent(controlObjectId, new ArrayList<>()).add(new SummonEffect(skill, effectCurTime));
+		_petEffects.computeIfAbsent(controlObjectId, k -> new ArrayList<>()).add(new SummonEffect(skill, effectCurTime));
 	}
 	
 	public boolean containsPetId(int controlObjectId)