🔀 Merge “release/v81” into “master”
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemoryPostReply.java
index a6686ca..e4a8f30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - MemoryPostReply.java - Copyright © 2013 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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 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<Post> getPost() {
-               return database.getPost(postId);
+               return fromNullable(database.getPost(postId));
        }
 
        //