From 3859336f0c6e3cc9e08706e0cf8b496c0c92dce8 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 1 Aug 2022 13:57:52 +0200 Subject: [PATCH] fix: Crash when selecting folder as custom font path Fixes #626 --- plugins/builtin/source/content/settings_entries.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 9b4a6df7f..fed596150 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -467,7 +467,7 @@ namespace hex::plugin::builtin { static void loadFontSettings() { std::fs::path fontFile = ContentRegistry::Settings::read("hex.builtin.setting.font", "hex.builtin.setting.font.font_path", ""); - if (!fs::exists(fontFile)) + if (!fs::exists(fontFile) || !fs::isRegularFile(fontFile)) fontFile.clear(); // If no custom font has been specified, search for a file called "font.ttf" in one of the resource folders