Skip to content

Commit

Permalink
Fix bugs in TaskList where last task can't be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahoyhp committed Aug 25, 2020
1 parent 9ac1c06 commit b975481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/duke/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public String toSaveFormat() {
}

public Task deleteTask(int index) throws DukeException {
if (index-1 < 1 || index >= this.tasks.size()) {
if (index-1 < 1 || index > this.tasks.size()) {
throw new DukeException("Task #" + index + "does not exist.\n" +
"To check for lists of Tasks, type \"list\"");
}
Expand Down

0 comments on commit b975481

Please sign in to comment.