diff --git a/src/main/java/com/github/yeriomin/playstoreapi/SearchIterator.java b/src/main/java/com/github/yeriomin/playstoreapi/SearchIterator.java index 0bc7b79..ac88d3b 100644 --- a/src/main/java/com/github/yeriomin/playstoreapi/SearchIterator.java +++ b/src/main/java/com/github/yeriomin/playstoreapi/SearchIterator.java @@ -70,7 +70,7 @@ private DocV2 findApps(DocV2 doc) { if (doc.getChildCount() > 0 && doc.getChild(0).getBackendId() == 3 && doc.getChild(0).getDocType() == 1) { return doc; } - if (doc.getChild(0).getChildCount() == 1) { + if (doc.getChildCount() > 0 && doc.getChild(0).getChildCount() == 1) { DocV2 moreResults = findMoreResults(doc); if (null != moreResults) { return DocV2.newBuilder(moreResults).addChild(0, doc.getChild(0).getChild(0)).build();