From 6f22d604246dbd6646e137de913901956c5de071 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:21:07 +0100 Subject: [PATCH] fix ManageCustomFont crash --- Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs index ba821277..e897b4e5 100644 --- a/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs @@ -46,7 +46,7 @@ private void ManageCustomFont() string type = dialog.FileName.Substring(dialog.FileName.Length-3, 3).ToLowerInvariant(); - if (!File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(FontHeaders[type])) + if (!FontHeaders.ContainsKey(type) || !File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(FontHeaders[type])) { Frontend.ShowMessageBox(Resources.Strings.Menu_Mods_Misc_CustomFont_Invalid, MessageBoxImage.Error); return;