X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2Fmemory%2FMemoryPostReply.java;h=e4a8f30d0d51d2c055bf94359337eb7542de2c96;hb=438378deab1514f0f608d975ef65f5b7aea44ccb;hp=a48b0170f2d88921e9e2af053acc93054c51c966;hpb=419098bcd6215125408b29e60bd888e60979d37b;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryPostReply.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryPostReply.java
index a48b017..e4a8f30 100644
--- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryPostReply.java
+++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryPostReply.java
@@ -1,5 +1,5 @@
/*
- * Sone - MemoryPostReply.java - Copyright © 2013â2015 David Roden
+ * Sone - MemoryPostReply.java - Copyright © 2013â2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
package net.pterodactylus.sone.database.memory;
+import static com.google.common.base.Optional.fromNullable;
+
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Sone;
@@ -26,8 +28,6 @@ import com.google.common.base.Optional;
/**
* Memory-based {@link PostReply} implementation.
- *
- * @author David âBombeâ Roden
*/
class MemoryPostReply implements PostReply {
@@ -97,7 +97,7 @@ class MemoryPostReply implements PostReply {
*/
@Override
public Sone getSone() {
- return soneProvider.getSone(soneId).get();
+ return soneProvider.getSone(soneId);
}
/**
@@ -150,7 +150,7 @@ class MemoryPostReply implements PostReply {
*/
@Override
public Optional getPost() {
- return database.getPost(postId);
+ return fromNullable(database.getPost(postId));
}
//