Merge pull request #491 from jedk1/master

Fix NPEs
This commit is contained in:
OmniCypher 2016-05-07 21:02:15 -07:00
commit bfe445bd92
2 changed files with 12 additions and 7 deletions

View file

@ -240,6 +240,9 @@ public class IceSpikeBlast extends IceAbility {
destination = target.getEyeLocation(); destination = target.getEyeLocation();
} }
if (sourceBlock == null) {
return;
}
location = sourceBlock.getLocation(); location = sourceBlock.getLocation();
if (destination.distanceSquared(location) < 1) { if (destination.distanceSquared(location) < 1) {
return; return;

View file

@ -341,13 +341,15 @@ public class SurgeWall extends WaterAbility {
} }
private static void finalRemoveWater(Block block) { private static void finalRemoveWater(Block block) {
if (AFFECTED_BLOCKS.containsKey(block)) { if (block != null) {
TempBlock.revertBlock(block, Material.AIR); if (AFFECTED_BLOCKS.containsKey(block)) {
AFFECTED_BLOCKS.remove(block); TempBlock.revertBlock(block, Material.AIR);
} AFFECTED_BLOCKS.remove(block);
if (WALL_BLOCKS.containsKey(block)) { }
TempBlock.revertBlock(block, Material.AIR); if (WALL_BLOCKS.containsKey(block)) {
WALL_BLOCKS.remove(block); TempBlock.revertBlock(block, Material.AIR);
WALL_BLOCKS.remove(block);
}
} }
} }