Skip to content

Commit

Permalink
Only delete old-format bank if save succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 committed Nov 14, 2019
1 parent aa106d8 commit d59176d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions 3ds/source/Bank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ bool Bank::hasChanged() const

void Bank::convertFromBankBin()
{
bool deleteOld = true;
Gui::waitFrame(i18n::localize("BANK_CONVERT"));
FSStream stream(Archive::sd(), "/3ds/PKSM/bank/bank.bin", FS_OPEN_READ);
size_t oldSize = stream.size();
Expand Down Expand Up @@ -442,11 +441,10 @@ void Bank::convertFromBankBin()

delete[] oldData;

if (deleteOld)
if (save())
{
Archive::deleteFile(Archive::sd(), u"/3ds/PKSM/bank/bank.bin");
}
save();
}

const std::string& Bank::name() const
Expand Down

0 comments on commit d59176d

Please sign in to comment.