diff --git a/src/main/java/com/cloudius/urchin/api/APIClient.java b/src/main/java/com/cloudius/urchin/api/APIClient.java index c80a658..90fdd53 100644 --- a/src/main/java/com/cloudius/urchin/api/APIClient.java +++ b/src/main/java/com/cloudius/urchin/api/APIClient.java @@ -677,6 +677,9 @@ public class APIClient { MultivaluedMap queryParams) { JsonObject obj = getJsonObj(string, queryParams); JsonArray arr = obj.getJsonArray("buckets"); + if (arr == null) { + return new long[0]; + } long res[] = new long[arr.size()]; for (int i = 0; i< arr.size(); i++) { res[i] = arr.getJsonNumber(i).longValue();