diff --git a/src/TextLogik.java b/src/TextLogik.java index 09e006b..74e5ffa 100644 --- a/src/TextLogik.java +++ b/src/TextLogik.java @@ -18,10 +18,10 @@ public class TextLogik { switch (command[0]) { case "ADD": if (command.length == 1) { - text.add(TextInput.getTextInput()); + checkIfSuccess(text.add(TextInput.getTextInput())); } else if (isNumeric(command[1])) { int line = Integer.parseInt(command[1]); - text.add(line, TextInput.getTextInput()); + checkIfSuccess(text.add(line, TextInput.getTextInput())); } else { textOutput.errorInvalidCommand(); } @@ -38,7 +38,14 @@ public class TextLogik { } break; case "DUMMY": - text.dummy(); + if (command.length == 1) { + checkIfSuccess(text.dummy()); + } else if (isNumeric(command[1])) { + int line = Integer.parseInt(command[1]); + checkIfSuccess(text.dummy(line)); + } else { + textOutput.errorInvalidCommand(); + } break; case "EXIT": break;