X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSearchPage.java;h=ceb192e165930c39d8d57a00da2cb5b197f9ffed;hb=58497297d2b9a18cd2877a226870acfe9e8837af;hp=6c9e15c3e1ee8766a45635f129a259e6f0f41226;hpb=e170df6684cbdfa8984289fcc2db54c545e21f9b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 6c9e15c..ceb192e 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -367,7 +367,7 @@ public class SearchPage extends SoneTemplatePage { */ private String getImageId(String phrase) { String imageId = phrase.startsWith("image://") ? phrase.substring(8) : phrase; - return (webInterface.getCore().getImage(imageId, false) != null) ? imageId : null; + return webInterface.getCore().getImage(imageId).isPresent() ? imageId : null; } /** @@ -581,7 +581,7 @@ public class SearchPage extends SoneTemplatePage { @Override public boolean apply(Hit hit) { - return hit.getScore() > 0; + return (hit == null) ? false : hit.getScore() > 0; } };