diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 17dcdafa6..041dc1797 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -474,12 +474,15 @@ namespace hex::plugin::builtin { (void)EventManager::subscribe([](prv::Provider *provider) { { - auto recentPath = fs::getDefaultPaths(fs::ImHexPath::Recent).front(); - auto fileName = hex::format("{:%y%m%d_%H%M%S}.json", fmt::gmtime(std::chrono::system_clock::now())); - fs::File recentFile(recentPath / fileName, fs::File::Mode::Create); + for (const auto &recentPath : fs::getDefaultPaths(fs::ImHexPath::Recent)) { + auto fileName = hex::format("{:%y%m%d_%H%M%S}.json", fmt::gmtime(std::chrono::system_clock::now())); + fs::File recentFile(recentPath / fileName, fs::File::Mode::Create); + if (!recentFile.isValid()) + continue; - if (auto settings = provider->storeSettings(); !settings.is_null()) - recentFile.write(settings.dump(4)); + if (auto settings = provider->storeSettings(); !settings.is_null()) + recentFile.write(settings.dump(4)); + } } updateRecentProviders();