diff --git a/src/main/java/com/gocardless/http/ListResponse.java b/src/main/java/com/gocardless/http/ListResponse.java index 47b37b23..a88c32d1 100644 --- a/src/main/java/com/gocardless/http/ListResponse.java +++ b/src/main/java/com/gocardless/http/ListResponse.java @@ -31,6 +31,9 @@ public List getItems() { * last page. */ public String getAfter() { + if (meta == null || meta.getCursors() == null) { + return null; + } return meta.getCursors().getAfter(); } @@ -39,6 +42,9 @@ public String getAfter() { * first page. */ public String getBefore() { + if (meta == null || meta.getCursors() == null) { + return null; + } return meta.getCursors().getBefore(); }