We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 556014b commit c343d96Copy full SHA for c343d96
src/main/java/com/francescodisalesdev/gitcli/service/GitService.java
@@ -73,8 +73,12 @@ public int getPages(String param) throws IOException
73
String URL = "https://github.com/search?q="+param;
74
Document document = Jsoup.connect(URL).get();
75
Elements elementsLinks = document.select("em");
76
+ String pages = elementsLinks.attr("data-total-pages").toString();
77
- int pagesValue = Integer.parseInt(elementsLinks.attr("data-total-pages").toString());
78
+ if(pages.isEmpty())
79
+ return 0;
80
+
81
+ int pagesValue = Integer.parseInt(pages);
82
return pagesValue;
83
84
}
0 commit comments