🚸 Only fail a comic state if there are no strips
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Sep 2020 11:22:49 +0000 (13:22 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Sep 2020 11:22:49 +0000 (13:22 +0200)
src/main/java/net/pterodactylus/rhynodge/filters/ComicSiteFilter.java

index 19286a6..818f711 100644 (file)
@@ -57,12 +57,12 @@ public abstract class ComicSiteFilter implements Filter {
                List<String> imageComments = extractImageComments(htmlState.document());
 
                /* store comic, if found, into state. */
-               if (!title.isPresent() || imageUrls.isEmpty()) {
+               if (imageUrls.isEmpty()) {
                        return new FailedState();
                }
 
                ComicState comicState = new ComicState();
-               Comic comic = new Comic(title.get());
+               Comic comic = new Comic(title.or(""));
                int imageCounter = 0;
                for (String imageUrl : imageUrls) {
                        String imageComment = (imageCounter < imageComments.size()) ? imageComments.get(imageCounter) : "";