diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java index 25177c816..ac2f0da9a 100644 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java @@ -28,7 +28,7 @@ public RegionsWithinColumnsDirectRule() { public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { ColumnsWithinRegionsDirectRule correspondingRule = new ColumnsWithinRegionsDirectRule(); String result = correspondingRule.checkRuleRawAt(transition, puzzleElement); - if (result.equals("Only black out cells outside the column(s)!")) { + if (result != null && result.equals("Only black out cells outside the column(s)!")) { return "Only black out cells outside the region(s)!"; } return result; diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java index 2635c40cf..8219f9c01 100644 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java @@ -29,7 +29,7 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem RowsWithinRegionsDirectRule correspondingRule = new RowsWithinRegionsDirectRule(); String result = correspondingRule.checkRuleRawAt(transition, puzzleElement); - if (result.equals("Only black out cells outside the row(s)!")) { + if (result != null && result.equals("Only black out cells outside the row(s)!")) { return "Only black out cells outside the region(s)!"; } return result; diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java index 3f56f33a1..39e3b46c4 100644 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java @@ -30,7 +30,7 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem ColumnsWithinRowsDirectRule correspondingRule = new ColumnsWithinRowsDirectRule(); String result = correspondingRule.checkRuleRawAt(transition, puzzleElement); - if (result.equals("Only black out cells outside the column(s)!")) { + if (result != null && result.equals("Only black out cells outside the column(s)!")) { return "Only black out cells outside the row(s)!"; } return result;