From 04a4957ccf9b2ab767a0b5bbb8da32a6d4faa5e8 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 22 Oct 2022 09:08:18 +0200 Subject: [PATCH] fix: Null and MemFile providers dumping `null` into recent files --- plugins/builtin/source/content/welcome_screen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index fcd8c8259..d9cc3660e 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -504,7 +504,8 @@ namespace hex::plugin::builtin { 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); - recentFile.write(provider->storeSettings().dump(4)); + if (auto settings = provider->storeSettings(); !settings.is_null()) + recentFile.write(settings.dump(4)); } updateRecentProviders();