aboutsummaryrefslogtreecommitdiff
path: root/src/esieequest/controller/commands/SaveCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/esieequest/controller/commands/SaveCommand.java')
-rw-r--r--src/esieequest/controller/commands/SaveCommand.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/esieequest/controller/commands/SaveCommand.java b/src/esieequest/controller/commands/SaveCommand.java
index 9e32762..3332059 100644
--- a/src/esieequest/controller/commands/SaveCommand.java
+++ b/src/esieequest/controller/commands/SaveCommand.java
@@ -13,7 +13,16 @@ public class SaveCommand implements Executable {
13 @Override 13 @Override
14 public void execute(final String argument, final Game game, final Viewable view) { 14 public void execute(final String argument, final Game game, final Viewable view) {
15 15
16 view.echo(game.serialise().toJSONString()); 16 if (argument == null) {
17 return;
18 }
19
20 if (argument.isEmpty()) {
21 return;
22 }
23
24 final String serialisedGame = game.serialise().toJSONString();
25 view.save(argument, serialisedGame);
17 26
18 } 27 }
19 28