From f71ebfe9c1069b389d5875c0d85810af7e70b220 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 24 May 2020 11:04:23 +0200 Subject: [PATCH] CheckNAND: Delete RFL_DB.dat if empty --- Source/Core/Core/WiiUtils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Core/Core/WiiUtils.cpp b/Source/Core/Core/WiiUtils.cpp index f22decaf19..e198e069e3 100644 --- a/Source/Core/Core/WiiUtils.cpp +++ b/Source/Core/Core/WiiUtils.cpp @@ -765,6 +765,18 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair) result.bad = true; } + // Clean up after a bug fixed in https://github.com/dolphin-emu/dolphin/pull/8802 + const std::string rfl_db_path = Common::GetMiiDatabasePath(Common::FROM_CONFIGURED_ROOT); + const File::FileInfo rfl_db(rfl_db_path); + if (rfl_db.Exists() && rfl_db.GetSize() == 0) + { + ERROR_LOG(CORE, "CheckNAND: RFL_DB.dat exists but is empty"); + if (repair) + File::Delete(rfl_db_path); + else + result.bad = true; + } + for (const u64 title_id : es->GetInstalledTitles()) { const std::string title_dir = Common::GetTitlePath(title_id, Common::FROM_CONFIGURED_ROOT);