From 2daca5c706e87329295786348f7aa5fd12a43b39 Mon Sep 17 00:00:00 2001 From: charlestian23 Date: Tue, 26 Sep 2023 17:03:21 -0400 Subject: [PATCH] Saving files now works --- .../puzzle/shorttruthtable/ShortTruthTableExporter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableExporter.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableExporter.java index bcb744789..74749e6a9 100644 --- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableExporter.java +++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableExporter.java @@ -2,6 +2,7 @@ import edu.rpi.legup.model.PuzzleExporter; import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard; import org.w3c.dom.Document; public class ShortTruthTableExporter extends PuzzleExporter { @@ -12,7 +13,11 @@ public ShortTruthTableExporter(ShortTruthTable stt) { @Override protected org.w3c.dom.Element createBoardElement(Document newDocument) { - ShortTruthTableBoard board = (ShortTruthTableBoard) puzzle.getTree().getRootNode().getBoard(); + ShortTruthTableBoard board; + if (puzzle.getTree() != null) + board = (ShortTruthTableBoard) puzzle.getTree().getRootNode().getBoard(); + else + board = (ShortTruthTableBoard) puzzle.getBoardView().getBoard(); org.w3c.dom.Element boardElement = newDocument.createElement("board");