fix NPE in public SoundEffectType visit(GameEventCardChangeZone event)

This commit is contained in:
Maxmtg
2013-06-17 07:33:50 +00:00
parent 502a087962
commit 39a88cd4d1

View File

@@ -38,7 +38,7 @@ public class EventVisualizer extends IGameEventVisitor.Base<SoundEffectType> {
public SoundEffectType visit(GameEventCardDestroyed event) { return SoundEffectType.Destroy; } public SoundEffectType visit(GameEventCardDestroyed event) { return SoundEffectType.Destroy; }
public SoundEffectType visit(GameEventCardEquipped event) { return SoundEffectType.Equip; } public SoundEffectType visit(GameEventCardEquipped event) { return SoundEffectType.Equip; }
public SoundEffectType visit(GameEventCardChangeZone event) { public SoundEffectType visit(GameEventCardChangeZone event) {
ZoneType from = event.from.getZoneType(); ZoneType from = event.from == null ? null : event.from.getZoneType();
ZoneType to = event.to.getZoneType(); ZoneType to = event.to.getZoneType();
if( from == ZoneType.Library && to == ZoneType.Hand) if( from == ZoneType.Library && to == ZoneType.Hand)
return SoundEffectType.Draw; return SoundEffectType.Draw;