Skip to content

Commit

Permalink
Fix addgame throwing illegalArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
JJtan2002 committed Nov 7, 2024
1 parent 30ffcbd commit abd1949
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ public CommandResult execute(Model model) throws CommandException {
throw new CommandException(MESSAGE_GAME_EXISTS);
}

Game editedGame = createNewGame(gameName, addGameDescriptor);
Game editedGame;
try {
editedGame = createNewGame(gameName, addGameDescriptor);
} catch (IllegalArgumentException e) {
throw new CommandException(e.getMessage());
}
gameMap.put(gameName, editedGame);
model.setPerson(personToEdit, personToEdit);
model.addCommandToLog(this);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<URL value="@HelpWindow.css" />
</stylesheets>
<VBox prefWidth="900.0" prefHeight="610">
<HBox alignment="CENTER" fx:id="helpMessageContainer">
<HBox alignment="TOP_RIGHT" fx:id="helpMessageContainer">
<children>
<Label fx:id="helpMessage" text="Label">
<HBox.margin>
Expand Down

0 comments on commit abd1949

Please sign in to comment.