diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java index 96f20ec3..86bb81b3 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java @@ -69,11 +69,13 @@ public class XhamsterRipper extends AbstractHTMLRipper { @Override public Document getNextPage(Document doc) throws IOException { - if (!doc.select("a.next").first().attr("href").equals("")) { - return Http.url(doc.select("a.next").first().attr("href")).get(); - } else { - throw new IOException("No more pages"); + if (doc.select("a.next").first() != null) { + if (doc.select("a.next").first().attr("href").startsWith("http")) { + return Http.url(doc.select("a.next").first().attr("href")).get(); + } } + throw new IOException("No more pages"); + } @Override