From aa6bf5a849003eabd92767b852d8a82071df6938 Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Sat, 12 Jan 2019 16:37:56 -0500 Subject: [PATCH] null checks for tempblocks in surge remove water --- .../projectkorra/projectkorra/waterbending/SurgeWall.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/waterbending/SurgeWall.java b/src/com/projectkorra/projectkorra/waterbending/SurgeWall.java index 7e7d9ab7..86436230 100644 --- a/src/com/projectkorra/projectkorra/waterbending/SurgeWall.java +++ b/src/com/projectkorra/projectkorra/waterbending/SurgeWall.java @@ -352,7 +352,9 @@ public class SurgeWall extends WaterAbility { if (!GeneralMethods.isAdjacentToThreeOrMoreSources(block)) { if (this.oldTemps.containsKey(block)) { final TempBlock tb = TempBlock.get(block); - tb.setType(this.oldTemps.get(block)); + if (tb != null) { + tb.setType(this.oldTemps.get(block)); + } } else { TempBlock.revertBlock(block, Material.AIR); } @@ -367,7 +369,9 @@ public class SurgeWall extends WaterAbility { if (AFFECTED_BLOCKS.containsKey(block)) { if (this.oldTemps.containsKey(block)) { final TempBlock tb = TempBlock.get(block); - tb.setType(this.oldTemps.get(block)); + if (tb != null) { + tb.setType(this.oldTemps.get(block)); + } } else { TempBlock.revertBlock(block, Material.AIR); }