From 0b15b62e3d619ea3f0ef8047dff63d668703ff6e Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Wed, 2 Oct 2024 12:09:46 +0100 Subject: [PATCH] Fix font file validation (#2982) --- Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs index fa2b984..3a116ff 100644 --- a/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs @@ -43,7 +43,8 @@ namespace Bloxstrap.UI.ViewModels.Settings string type = dialog.FileName.Substring(dialog.FileName.Length-3, 3).ToLowerInvariant(); - if (!FontHeaders.ContainsKey(type) || !File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(FontHeaders[type])) + if (!FontHeaders.ContainsKey(type) + || !FontHeaders.Any(x => File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(x.Value))) { Frontend.ShowMessageBox(Strings.Menu_Mods_Misc_CustomFont_Invalid, MessageBoxImage.Error); return;