Skip to content

Commit

Permalink
Closes #20 avoiding null reference when no LocatedWindows in arrangement
Browse files Browse the repository at this point in the history
  • Loading branch information
bright-tools committed Sep 17, 2016
1 parent 6383489 commit 4355be0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DeRange/Forms/ArrangementEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ private void SetArrangementEditEnabled()
private void SetLocatedWindowButtons()
{
bool enabled = (m_config.Arrangements.Count > 0) && (SelectedArrangement!= null) && (SelectedLocatedWindow != null);
upButton.Enabled = enabled && (SelectedLocatedWindow != SelectedArrangement.WindowPositions.First());
downButton.Enabled = enabled && (SelectedLocatedWindow != SelectedArrangement.WindowPositions.Last());
upButton.Enabled = enabled && (SelectedLocatedWindow != SelectedArrangement.WindowPositions.FirstOrDefault());
downButton.Enabled = enabled && (SelectedLocatedWindow != SelectedArrangement.WindowPositions.LastOrDefault());
}

void windowConfigurationListChanged(object sender, ListChangedEventArgs e)
Expand Down

0 comments on commit 4355be0

Please sign in to comment.