aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index a910c7d5b73..927cd512148 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -725,7 +725,6 @@ public class IssueIndex extends BaseIndex {
// Scrolling within the index
private Iterator<IssueDoc> scroll(final String scrollId) {
return new Iterator<IssueDoc>() {
-
private final Queue<SearchHit> hits = new ArrayDeque<>();
@Override
@@ -740,6 +739,9 @@ public class IssueIndex extends BaseIndex {
@Override
public IssueDoc next() {
+ if(!hasNext()){
+ throw new NoSuchElementException();
+ }
return new IssueDoc(hits.poll().getSource());
}