From cb65a4ec2d7373d3b28369d60930475d9405a8a5 Mon Sep 17 00:00:00 2001 From: Maxim Sizonenko Date: Thu, 20 Feb 2020 11:19:45 +0700 Subject: [PATCH] Fix pagination --- .../enumerators/BaseResourceCollectionEnumerator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/microsoft/store/partnercenter/enumerators/BaseResourceCollectionEnumerator.java b/src/main/java/com/microsoft/store/partnercenter/enumerators/BaseResourceCollectionEnumerator.java index 5841403..94af21b 100644 --- a/src/main/java/com/microsoft/store/partnercenter/enumerators/BaseResourceCollectionEnumerator.java +++ b/src/main/java/com/microsoft/store/partnercenter/enumerators/BaseResourceCollectionEnumerator.java @@ -135,6 +135,10 @@ public void next(IRequestContext context) this.getPartner(), responseType, this.resourceCollection.getLinks().getNext()); + if (!this.hasValue()) + { + throw new UnsupportedOperationException("The enumerator does not have a current value"); + } } } @@ -171,6 +175,10 @@ public void previous(IRequestContext context) this.getPartner(), responseType, this.resourceCollection.getLinks().getPrevious()); + if (!this.hasValue()) + { + throw new UnsupportedOperationException("The enumerator does not have a current value"); + } } } } \ No newline at end of file