projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix null pointer access when a reply’s post is yet unknown.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
notify
/
ListNotificationFilters.java
diff --git
a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
index
813b82d
..
a6ef8aa
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
+++ b/
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
@@
-90,7
+90,7
@@
public class ListNotificationFilters {
}
List<Post> newPosts = new ArrayList<Post>();
for (Post post : newPostNotification.getElements()) {
}
List<Post> newPosts = new ArrayList<Post>();
for (Post post : newPostNotification.getElements()) {
- if (currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone())) {
+ if (currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone())
|| currentSone.equals(post.getRecipient())
) {
newPosts.add(post);
}
}
newPosts.add(post);
}
}
@@
-125,7
+125,7
@@
public class ListNotificationFilters {
}
List<Reply> newReplies = new ArrayList<Reply>();
for (Reply reply : newReplyNotification.getElements()) {
}
List<Reply> newReplies = new ArrayList<Reply>();
for (Reply reply : newReplyNotification.getElements()) {
- if (
currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone
())) {
+ if (
((reply.getPost().getSone() != null) && currentSone.hasFriend(reply.getPost().getSone().getId())) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient
())) {
newReplies.add(reply);
}
}
newReplies.add(reply);
}
}