X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSearchPage.java;h=d50a254d5d396ac7967d872bc7ccbc6146ba5574;hp=6f5e001ad290d6451f382c99fb83ee2c1ac76ddc;hb=084e8ed97fd315caadb5051e21ed50c29be9de0e;hpb=b143833e69f288e4a45bdbce13e1d1fd32d6047a diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 6f5e001..d50a254 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -83,6 +83,9 @@ public class SearchPage extends SoneTemplatePage { } List phrases = parseSearchPhrases(query); + if (phrases.isEmpty()) { + throw new RedirectException("index.html"); + } Set sones = webInterface.getCore().getSones(); Set> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR);