Skip to content

Commit

Permalink
Fix org.getMembers() to 'wrap' returned users for post-populating
Browse files Browse the repository at this point in the history
This fixes an issue introduced with PR #66 in commit fee02a3 - the
`getMembers()` method switched to using paging, but lost the code that
populated the users with a full set of values.

This commit just applies 'wrapping' to all users returned, so that methods
like `user.getCreatedAt()` can be called on returned users without throwing
a NullPointerException - the reference to 'root' allows the user objects to
populate themselves.
  • Loading branch information
rtyley committed Mar 14, 2014
1 parent 9930e7b commit d29ea97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/kohsuke/github/GHOrganization.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public PagedIterator<GHUser> iterator() {
String filterParams = (filter == null) ? "" : ("?filter=" + filter);
return new PagedIterator<GHUser>(root.retrieve().asIterator(String.format("/orgs/%s/%s%s", login, suffix, filterParams), GHUser[].class)) {
@Override
protected void wrapUp(GHUser[] page) {
protected void wrapUp(GHUser[] users) {
GHUser.wrap(users, root);
}
};
}
Expand Down

0 comments on commit d29ea97

Please sign in to comment.