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

Commit 24187e7

Browse files
Merge branch 'master' into fixes/256-ignored-files
2 parents 3777591 + 621c46f commit 24187e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GitHub.Api/Git/GitConfig.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ public IEnumerable<ConfigRemote> GetRemotes()
8686
return groups
8787
.Where(x => x.Key == "remote")
8888
.SelectMany(x => x.Value)
89+
.Where(x => x.Value.TryGetString("url") != null)
8990
.Select(x => new ConfigRemote
9091
{
9192
Name = x.Key,
92-
Url = x.Value.GetString("url")
93+
Url = x.Value.TryGetString("url")
9394
});
9495
}
9596

@@ -98,7 +99,7 @@ public IEnumerable<ConfigRemote> GetRemotes()
9899
return groups
99100
.Where(x => x.Key == "remote")
100101
.SelectMany(x => x.Value)
101-
.Where(x => x.Key == remote)
102+
.Where(x => x.Key == remote && x.Value.TryGetString("url") != null)
102103
.Select(x => new ConfigRemote
103104
{
104105
Name = x.Key,

0 commit comments

Comments
 (0)