Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit bb7893a

Browse files
committed
Allow null items in RepositoryGroupDescription.
Not sure why, but null items are occasionally getting passed to `RepositoryGroupDescription.GroupNameFromItem`. There seems to be no consistent repro for this, so if it happens assign them to an "empty string" group and hope nothing else blows up! Fixes #1159
1 parent ffe9738 commit bb7893a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/GitHub.VisualStudio/UI/Views/Controls/RepositoryCloneControl.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ public RepositoryGroupDescription(RepositoryCloneControl owner)
8888

8989
public override object GroupNameFromItem(object item, int level, System.Globalization.CultureInfo culture)
9090
{
91-
Guard.ArgumentNotNull(item, nameof(item));
9291
Guard.ArgumentNotNull(culture, nameof(culture));
9392

9493
var repo = item as IRemoteRepositoryModel;
95-
var name = repo.Owner;
94+
var name = repo?.Owner ?? string.Empty;
9695
RepositoryGroup group;
9796

9897
if (!owner.groups.TryGetValue(name, out group))

0 commit comments

Comments
 (0)