Skip to content

Commit

Permalink
Fix a bug in SimpleConnection where if a 'last' argument is used that…
Browse files Browse the repository at this point in the history
… was larger than the data set an error was thrown.
  • Loading branch information
misterzirillo authored and dminkovsky committed Oct 25, 2016
1 parent a307914 commit 7b87d54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/graphql/relay/SimpleListConnection.java
Expand Up @@ -55,7 +55,7 @@ public Object get(DataFetchingEnvironment environment) {
edges = edges.subList(0, first <= edges.size() ? first : edges.size());
}
if (last != null) {
edges = edges.subList(edges.size() - last, edges.size());
edges = edges.subList( last > edges.size() ? 0 : edges.size() - last, edges.size());
}

if (edges.size() == 0) {
Expand Down

0 comments on commit 7b87d54

Please sign in to comment.