Check a reply’s post and its Sone before using those values.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 25 Apr 2011 20:52:04 +0000 (22:52 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 25 Apr 2011 20:52:04 +0000 (22:52 +0200)
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java

index 7d581d7..9531a6d 100644 (file)
@@ -114,7 +114,7 @@ public class GetStatusAjaxPage extends JsonPage {
 
                                @Override
                                public boolean filterObject(Reply reply) {
-                                       return currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient());
+                                       return (reply.getPost() != null) && (reply.getPost().getSone() != null) && (currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient()));
                                }
 
                        });