Fix error when removing reply for unknown post.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Feb 2013 07:07:24 +0000 (08:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Feb 2013 07:07:24 +0000 (08:07 +0100)
src/main/java/net/pterodactylus/sone/web/WebInterface.java

index 3bb11d5..faba61f 100644 (file)
@@ -938,7 +938,7 @@ public class WebInterface {
                PostReply reply = postReplyRemovedEvent.postReply();
                newReplyNotification.remove(reply);
                localReplyNotification.remove(reply);
-               if (!getMentionedSones(reply.getText()).isEmpty()) {
+               if (!getMentionedSones(reply.getText()).isEmpty() && reply.getPost().isPresent()) {
                        boolean isMentioned = false;
                        for (PostReply existingReply : getCore().getReplies(reply.getPost().get())) {
                                isMentioned |= !reply.isKnown() && !getMentionedSones(existingReply.getText()).isEmpty();