Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

893 readonlypagecollection null body #897

Merged
merged 2 commits into from
Sep 17, 2015
Merged

893 readonlypagecollection null body #897

merged 2 commits into from
Sep 17, 2015

Conversation

adamralph
Copy link
Contributor

fixes #893

@@ -11,7 +11,7 @@ public class ReadOnlyPagedCollection<T> : ReadOnlyCollection<T>, IReadOnlyPagedC
readonly Func<Uri, Task<IApiResponse<List<T>>>> _nextPageFunc;

public ReadOnlyPagedCollection(IApiResponse<List<T>> response, Func<Uri, Task<IApiResponse<List<T>>>> nextPageFunc)
: base(response != null ? response.Body : new List<T>())
: base(response != null ? response.Body ?? new List<T>() : new List<T>())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I really understand the power of the ?. operator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! 😒

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably upgrade our compiler to use C# 6 if someone wants to take a crack at it. As long as we don't break our other platforms.

haacked added a commit that referenced this pull request Sep 17, 2015
…l-body

893 readonlypagecollection null body
@haacked haacked merged commit 5610478 into octokit:master Sep 17, 2015
@haacked
Copy link
Contributor

haacked commented Sep 17, 2015

selfie-0

@haacked
Copy link
Contributor

haacked commented Sep 17, 2015

This is now live on NuGet as of version 0.16.0!

@khellang
Copy link
Contributor

👏

@adamralph adamralph deleted the 893-readonlypagecollection-null-body branch September 18, 2015 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retrieving contributors for an empty repo throws an ANE
4 participants