Skip to content

Commit

Permalink
Fixed crashes when OLV objects collection is not yet initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Klocman committed Apr 14, 2018
1 parent eb7822f commit 8f6c360
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public RelatedUninstallerAdder()
olvColumnName.AspectGetter = rowObject => ((RelatedApplicationEntry)rowObject).Entry.DisplayName;
}

private IEnumerable<RelatedApplicationEntry> Entries => objectListView1.Objects.Cast<RelatedApplicationEntry>();
private IEnumerable<RelatedApplicationEntry> Entries => (objectListView1.Objects ?? Enumerable.Empty<RelatedApplicationEntry>()).Cast<RelatedApplicationEntry>();

public IEnumerable<ApplicationUninstallerEntry> GetResults()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public UninstallConfirmation()
objectListView1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
}

private IEnumerable<ConfirmationEntry> Entries => objectListView1.Objects.Cast<ConfirmationEntry>();
private IEnumerable<ConfirmationEntry> Entries => (objectListView1.Objects ?? Enumerable.Empty<ConfirmationEntry>()).Cast<ConfirmationEntry>();

private void buttonSort_Click(object sender, EventArgs e)
{
Expand Down

0 comments on commit 8f6c360

Please sign in to comment.