From 28b0c5550f1a2c1009f62ba43a038f2f2a878781 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 26 Mar 2011 00:35:13 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20throw=20exceptions=20when=20a=20?= =?utf8?q?single=20=E2=80=9Creturn=E2=80=9D=20would=20suffice.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/UploadImagePage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java index 17538a6..06afa8c 100644 --- a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java @@ -70,7 +70,7 @@ public class UploadImagePage extends SoneTemplatePage { String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36); Album parent = webInterface.getCore().getAlbum(parentId, false); if (parent == null) { - throw new RedirectException("invalid.html"); + return; } String name = request.getHttpRequest().getPartAsStringFailsafe("title", 200); String description = request.getHttpRequest().getPartAsStringFailsafe("description", 4000); @@ -91,7 +91,7 @@ public class UploadImagePage extends SoneTemplatePage { uploadedImage.flush(); } catch (IOException ioe1) { logger.log(Level.WARNING, "Could not read uploaded image!", ioe1); - throw new RedirectException("invalid.html"); + return; } finally { Closer.close(imageInputStream); fileBucket.free(); -- 2.7.4