Skip to content

Commit

Permalink
Fix argument out of range exception in manage game instances dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Sep 3, 2024
1 parent abd307c commit 2ddf740
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions GUI/Dialogs/ManageGameInstancesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,14 @@ private void Forget_Click(object? sender, EventArgs? e)

private void UpdateButtonState()
{
if (GameInstancesListView.SelectedItems[0].Tag is string instName)
{
RenameButton.Enabled = SelectButton.Enabled = SetAsDefaultCheckbox.Enabled = CloneGameInstanceMenuItem.Enabled = HasSelections;
ForgetButton.Enabled = HasSelections && instName != manager.CurrentInstance?.Name;
ImportFromSteamMenuItem.Enabled = manager.SteamLibrary.Games.Length > 0;
}
RenameButton.Enabled = SelectButton.Enabled
= SetAsDefaultCheckbox.Enabled
= CloneGameInstanceMenuItem.Enabled
= HasSelections;
ForgetButton.Enabled = HasSelections
&& GameInstancesListView.SelectedItems[0].Tag is string instName
&& instName != manager.CurrentInstance?.Name;
ImportFromSteamMenuItem.Enabled = manager.SteamLibrary.Games.Length > 0;
}

private readonly GameInstanceManager manager;
Expand Down

0 comments on commit 2ddf740

Please sign in to comment.