Skip to content

Commit

Permalink
Merge #4054 Fix NRE on trying to update all when there's nothing to u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
HebaruSan committed Mar 10, 2024
2 parents 1cd1901 + 59a7152 commit 7b66b1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file.
- [Multiple] De-over-parallelize Versions tab (#4049 by: HebaruSan)
- [GUI] Use better console hiding API (#4051 by: HebaruSan)
- [Core] Trigger progress updates for frozen downloads (#4052 by: HebaruSan)
- [GUI] Fix NRE on trying to update all when there's nothing to update (#4054 by: HebaruSan)

### Internal

Expand Down
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 7b66b1e

Please sign in to comment.