From 831127ee62043d6ec1780a4a4bc331b5a5693b1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 17 Nov 2010 22:09:11 +0100 Subject: [PATCH] Verify post better. --- src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java index d874493..d2a7a39 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java @@ -49,9 +49,9 @@ public class DeletePostAjaxPage extends JsonPage { @Override protected JsonObject createJsonObject(Request request) { String postId = request.getHttpRequest().getParam("post"); - Post post = webInterface.getCore().getPost(postId); + Post post = webInterface.getCore().getPost(postId, false); Sone currentSone = getCurrentSone(request.getToadletContext()); - if (post == null) { + if ((post == null) || (post.getSone() == null)) { return createErrorJsonObject("invalid-post-id"); } if (currentSone == null) { -- 2.7.4