Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing IndexOutOfBoundsException when handling BatchResults

  • Loading branch information...
commit 8dae896c2d3eabb691c842345a26f3c060ea891a 1 parent a6494e3
@clamprecht clamprecht authored
View
3  src/main/java/com/flaptor/indextank/apiclient/IndexTankClient.java
@@ -857,10 +857,11 @@ public BatchResults addDocuments(Iterable<Document> documents)
Boolean added = (Boolean) result.get("added");
addeds.add(i, added);
+ errors.add(i, null); // populate every index position to avoid IndexOutOfBoundsException below
if (!added) {
hasErrors = true;
- errors.add(i, (String) result.get("error"));
+ errors.set(i, (String) result.get("error"));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.