Skip to content

Commit

Permalink
Duke A-Assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicljr committed Feb 7, 2023
1 parent 15154a2 commit 35810a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/duke/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void saveTasks(TaskList taskList) {
/**
* Loads all the task from the previous run.
* Tasks are all saved in a separate file.
* Asserts that the file must exist at the point of loading tasks.
*
* @param taskList the current tasklist
* @throws IOException catch for Input and Output inconsistencies.
Expand All @@ -59,6 +60,8 @@ public void loadTasks(TaskList taskList) throws IOException, DukeException {
file.createNewFile();
}

assert file.exists(): "File that is to save Tasks does not exist!";

Scanner sc = new Scanner(file);

while (sc.hasNext()) {
Expand Down

0 comments on commit 35810a9

Please sign in to comment.