From e4706628855adbbac771eaab6605c639dbe7b331 Mon Sep 17 00:00:00 2001 From: Sergey Eremin Date: Thu, 13 Apr 2017 01:01:54 +0300 Subject: [PATCH] Fixing broken search type 2 test --- .../java/com/github/yeriomin/playstoreapi/SearchIterator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();