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

Commit 0735fa9

Browse files
committed
Catch exceptions thrown in GitHubConnectSection.
Trying to get the info for the icon in the repo list can throw if the repository has been deleted. Handle this.
1 parent 75472b4 commit 0735fa9

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/GitHub.TeamFoundation.14/Connect/GitHubConnectSection.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,13 @@ async void UpdateRepositoryList(object sender, NotifyCollectionChangedEventArgs
216216
HandleClonedRepo(newrepo);
217217

218218
isCreating = isCloning = false;
219-
var repo = await ApiFactory.Create(newrepo.CloneUrl).GetRepository();
220-
newrepo.SetIcon(repo.Private, repo.Fork);
219+
220+
try
221+
{
222+
var repo = await ApiFactory.Create(newrepo.CloneUrl).GetRepository();
223+
newrepo.SetIcon(repo.Private, repo.Fork);
224+
}
225+
catch { }
221226
}
222227
// looks like it's just a refresh with new stuff on the list, update the icons
223228
else
@@ -228,8 +233,12 @@ async void UpdateRepositoryList(object sender, NotifyCollectionChangedEventArgs
228233
{
229234
if (Equals(Holder.ActiveRepo, r))
230235
SelectedRepository = r;
231-
var repo = await ApiFactory.Create(r.CloneUrl).GetRepository();
232-
r.SetIcon(repo.Private, repo.Fork);
236+
237+
try
238+
{
239+
var repo = await ApiFactory.Create(r.CloneUrl).GetRepository();
240+
r.SetIcon(repo.Private, repo.Fork);
241+
} catch { }
233242
});
234243
}
235244
}

0 commit comments

Comments
 (0)