Skip to content

Commit

Permalink
Merge pull request #619 from charlestian23/puzzle_editor-short_truth_…
Browse files Browse the repository at this point in the history
…table

Saving files now works
  • Loading branch information
charlestian23 authored Sep 26, 2023
2 parents f994a07 + 0cb069b commit 17e1581
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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");

Expand Down

0 comments on commit 17e1581

Please sign in to comment.