projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make post returned by post provider optional.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
MarkAsKnownAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
index
fec5800
..
997c9dc
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
@@
-59,11
+59,11
@@
public class MarkAsKnownAjaxPage extends JsonPage {
Core core = webInterface.getCore();
for (String id : ids) {
if (type.equals("post")) {
Core core = webInterface.getCore();
for (String id : ids) {
if (type.equals("post")) {
-
Post
post = core.getPost(id);
- if (
post == null
) {
+
Optional<Post>
post = core.getPost(id);
+ if (
!post.isPresent()
) {
continue;
}
continue;
}
- core.markPostKnown(post);
+ core.markPostKnown(post
.get()
);
} else if (type.equals("reply")) {
Optional<PostReply> reply = core.getPostReply(id);
if (!reply.isPresent()) {
} else if (type.equals("reply")) {
Optional<PostReply> reply = core.getPostReply(id);
if (!reply.isPresent()) {