X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2Fmemory%2FMemoryPostReply.java;h=40f07759adfe6e6882bd69051dc307473cce0ce8;hb=ae0140e054f0e2cb4e0385951224a625cdf7f9a2;hp=a6686ca7a5c622fa774db83ff95690a30f94b5d9;hpb=6e9a43ccd93ae125720547c0fe421dc81a54ba90;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 a6686ca..40f0775 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 David Roden
+ * Sone - MemoryPostReply.java - Copyright © 2013â2019 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));
}
//