Skip to content

Commit

Permalink
Fix clearing of account file if FileCorruptedException thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
vibes-863 committed Apr 14, 2024
1 parent 7db0f38 commit 562a919
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/budgetbuddy/storage/DataStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public AccountManager loadAccounts() {
accounts = readAccountFile(existingAccountNumbers);
} catch (FileCorruptedException e) {
UserInterface.printFileCorruptedError();
FileWriter fw = new FileWriter(ACCOUNTS_FILE_PATH, false);
return createNewAccountManager();
}
if (accounts.isEmpty()) {
Expand Down

0 comments on commit 562a919

Please sign in to comment.