Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 6dcc6c7

Browse files
Preventing exception for remotes without branches
1 parent 0773af0 commit 6dcc6c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/GitHub.Api/Git/Repository.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ private void RepositoryManager_OnRemoteBranchListUpdated(Dictionary<string, Dict
227227
Logger.Trace("RemoteBranchListUpdated");
228228

229229
remoteBranches = branches;
230-
remotes = branches.ToDictionary(pair => pair.Key, pair => pair.Value.Values.First().Remote.Value);
230+
remotes = branches
231+
.Where(pair => pair.Value.Any())
232+
.ToDictionary(pair => pair.Key, pair => pair.Value.First().Value.Remote.Value);
231233

232234
OnRemoteBranchListChanged?.Invoke();
233235
}

0 commit comments

Comments
 (0)