fix: Crash when selecting folder as custom font path

Fixes #626
This commit is contained in:
WerWolv 2022-08-01 13:57:52 +02:00
parent e530cdbc7f
commit 3859336f0c
1 changed files with 1 additions and 1 deletions

View File

@ -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