Fix null pointer access when a reply’s post is yet unknown.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 12 Apr 2011 16:57:02 +0000 (18:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 12 Apr 2011 16:57:02 +0000 (18:57 +0200)
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java

index 2a98ec8..a6ef8aa 100644 (file)
@@ -125,7 +125,7 @@ public class ListNotificationFilters {
                }
                List<Reply> newReplies = new ArrayList<Reply>();
                for (Reply reply : newReplyNotification.getElements()) {
-                       if (currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient())) {
+                       if (((reply.getPost().getSone() != null) && currentSone.hasFriend(reply.getPost().getSone().getId())) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient())) {
                                newReplies.add(reply);
                        }
                }