From 97bfb4004b3928e5170c3565502b37f910681967 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 13 Mar 2022 17:11:02 +0100 Subject: [PATCH] fix: Crash when custom font file can't be found Fixes #468 --- main/source/init/tasks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index 9144662a0..cbe1154ec 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -95,6 +95,8 @@ namespace hex::init { ImFontConfig cfg = {}; std::fs::path fontFile = ContentRegistry::Settings::read("hex.builtin.setting.font", "hex.builtin.setting.font.font_path", ""); + if (!fs::exists(fontFile)) + fontFile.clear(); // If no custom font has been specified, search for a file called "font.ttf" in one of the resource folders if (fontFile.empty()) {