Skip to content

Commit

Permalink
fix ManageCustomFont crash
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepilledgreat committed Jun 20, 2024
1 parent 69a059e commit 6f22d60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Bloxstrap/UI/ViewModels/Menu/ModsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f22d60

Please sign in to comment.