Skip to content

Commit 767b640

Browse files
committed
Handle invalid usernames to getRepositories better.
1 parent 1c9d5bb commit 767b640

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Git.hub/Client.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public IList<Repository> getRepositories(string username)
8181
request.AddUrlSegment("name", username);
8282

8383
var list = client.Get<List<Repository>>(request).Data;
84+
if (list == null)
85+
throw new InvalidOperationException("User does not exist.");
8486
list.ForEach(r => r._client = client);
8587
return list;
8688
}

0 commit comments

Comments
 (0)