Skip to content

Commit

Permalink
Fix NRE on trying to update all when there's nothing to update
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Mar 10, 2024
1 parent 1cd1901 commit 59a7152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions GUI/Controls/ManageMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@ private void ChangeSetUpdated()
var removing = changeIdentifiersOfType(GUIModChangeType.Remove)
.Except(changeIdentifiersOfType(GUIModChangeType.Install))
.ToHashSet();
foreach (var kvp in mainModList.full_list_of_mod_rows)
foreach ((string ident, DataGridViewRow row) in mainModList.full_list_of_mod_rows)
{
if (removing.Contains(kvp.Key))
if (removing.Contains(ident))
{
// Set strikeout font for rows being uninstalled
kvp.Value.DefaultCellStyle.Font = uninstallingFont;
row.DefaultCellStyle.Font = uninstallingFont;
}
else if (kvp.Value.DefaultCellStyle.Font != null)
else if (row.DefaultCellStyle.Font != null)
{
// Clear strikeout font for rows not being uninstalled
kvp.Value.DefaultCellStyle.Font = null;
row.DefaultCellStyle.Font = null;
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion GUI/Model/ModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum GUIModFilter
public class ModList
{
//identifier, row
internal Dictionary<string, DataGridViewRow> full_list_of_mod_rows;
internal Dictionary<string, DataGridViewRow> full_list_of_mod_rows = new Dictionary<string, DataGridViewRow>();

public event Action ModFiltersUpdated;
public IReadOnlyCollection<GUIMod> Modules { get; private set; } =
Expand Down

0 comments on commit 59a7152

Please sign in to comment.