Skip to content

Commit

Permalink
Fix bug on incorrect task storage handling after delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
freddychenyouren2 committed Oct 7, 2023
1 parent 165ea17 commit 534733e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions data/duke.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
T | 0 | reset | null | null
T | 0 | another test | null | null
D | 0 | hndoa | 1111-11-11 | null
T | 0 | bjjkvd | null | null
D | 1 | dead 2 | 1111-11-11 | null
E | 1 | event 3 | 1111-11-11 | 1112-11-11
T | 0 | test 5 | null | null
2 changes: 1 addition & 1 deletion src/main/java/duke/util/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ protected void clearAllData() throws IOException {
*/
protected void updateData() throws IOException {
for (int i = 0; i < listOfTasks.size(); i++) {
saveTask(listOfTasks.get(i), i != 0);
saveTask(listOfTasks.get(i), true);
}
}
}

0 comments on commit 534733e

Please sign in to comment.