From b05d24dd14645c4fbb45719b32d16fa5d5c9d4b0 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 9 Jul 2023 07:11:03 +0000 Subject: [PATCH] Make font loading more robust --- app/src/main/java/io/xpipe/app/core/AppFont.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/core/AppFont.java b/app/src/main/java/io/xpipe/app/core/AppFont.java index dd9827955..d6343ba62 100644 --- a/app/src/main/java/io/xpipe/app/core/AppFont.java +++ b/app/src/main/java/io/xpipe/app/core/AppFont.java @@ -1,7 +1,6 @@ package io.xpipe.app.core; import io.xpipe.app.issue.TrackEvent; -import io.xpipe.app.prefs.AppPrefs; import io.xpipe.core.process.OsType; import javafx.css.Size; import javafx.css.SizeUnits; @@ -70,6 +69,8 @@ public class AppFont { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { try (var in = Files.newInputStream(file)) { Font.loadFont(in, 12); + } catch (Throwable t) { + // Font loading can fail in rare cases. This is however not important, so we can just ignore it } return FileVisitResult.CONTINUE; }