Skip to content

Commit

Permalink
Merge pull request #153 from vibes-863/fix-dataStorage-bug
Browse files Browse the repository at this point in the history
Fix clearing of account file if FileCorruptedException thrown
  • Loading branch information
vibes-863 committed Apr 14, 2024
2 parents 7db0f38 + 562a919 commit 18d5475
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 18d5475

Please sign in to comment.