From 087885475971c2982dd70a78fc1a1fc42a93ca54 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Fri, 29 Apr 2022 09:00:01 -0700 Subject: [PATCH] Fix crash in font picker It's possible to have multiple fonts with the same font family. Don't use the list add method that throws an exception when it finds a duplicate key. --- SourceGen/WpfGui/FontPicker.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SourceGen/WpfGui/FontPicker.xaml.cs b/SourceGen/WpfGui/FontPicker.xaml.cs index 6b14105..f0376b0 100644 --- a/SourceGen/WpfGui/FontPicker.xaml.cs +++ b/SourceGen/WpfGui/FontPicker.xaml.cs @@ -90,7 +90,7 @@ namespace SourceGen.WpfGui { continue; } - tmpList.Add(familyName, typ.FontFamily); + tmpList[familyName] = typ.FontFamily; if (familyName.Equals(initialFamily)) { SelectedFamily = typ.FontFamily;