Skip to content

Commit

Permalink
Merge pull request #2127 from pizzaboxer/bugfix/fix-managecustomfont-…
Browse files Browse the repository at this point in the history
…crash

Fix ManageCustomFont crash
  • Loading branch information
pizzaboxer committed Jun 22, 2024
2 parents b198be4 + 6f22d60 commit bf412cd
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 bf412cd

Please sign in to comment.