X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FUploadImagePage.java;h=d938641f6384cd3788836b7ffc8f10f85e34586d;hb=1360e42f232e2f0fd2ae0cb1308b2c3fe1f57ce7;hp=2079cacadb3cc79880c37f2202ad4c8421f0379a;hpb=00a7e47e114cf24f9ab5731bcbe1abeafe435577;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java index 2079cac..d938641 100644 --- a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java @@ -81,14 +81,12 @@ public class UploadImagePage extends SoneTemplatePage { if (request.getMethod() == Method.POST) { Sone currentSone = getCurrentSone(request.getToadletContext()); String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36); - Album parent = webInterface.getCore().getAlbum(parentId, false); + Album parent = webInterface.getCore().getAlbum(parentId); if (parent == null) { - /* TODO - signal error */ - return; + throw new RedirectException("noPermission.html"); } if (!currentSone.equals(parent.getSone())) { - /* TODO - signal error. */ - return; + throw new RedirectException("noPermission.html"); } String name = request.getHttpRequest().getPartAsStringFailsafe("title", 200); String description = request.getHttpRequest().getPartAsStringFailsafe("description", 4000);