X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreateAlbumPage.java;h=6f71741cc648169614872e633b476f0c85e4e8f7;hb=9f1e09d12a8e07cd235dfb790747e04ecfba3965;hp=76a71d6224d8bf942a9b45bca7d1d9706638181c;hpb=ec06ae64c86f0b06bb0cf9f8b289e7907e81dffa;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java index 76a71d6..6f71741 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java @@ -18,6 +18,7 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Album; +import net.pterodactylus.sone.data.impl.AlbumImpl.AlbumTitleMustNotBeEmpty; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.text.TextFilter; import net.pterodactylus.sone.web.page.FreenetRequest; @@ -68,7 +69,11 @@ public class CreateAlbumPage extends SoneTemplatePage { parent = currentSone.getRootAlbum(); } Album album = webInterface.getCore().createAlbum(currentSone, parent); - album.modify().setTitle(name).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description)).update(); + try { + album.modify().setTitle(name).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description)).update(); + } catch (AlbumTitleMustNotBeEmpty atmnbe) { + throw new RedirectException("emptyAlbumTitle.html"); + } webInterface.getCore().touchConfiguration(); throw new RedirectException("imageBrowser.html?album=" + album.getId()); }