Expose following times from FriendProvider
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemoryPostReply.java
index a6686ca..687c28a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - MemoryPostReply.java - Copyright © 2013 David Roden
+ * Sone - MemoryPostReply.java - Copyright © 2013–2016 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;
@@ -97,7 +99,7 @@ class MemoryPostReply implements PostReply {
         */
        @Override
        public Sone getSone() {
-               return soneProvider.getSone(soneId).get();
+               return soneProvider.getSone(soneId);
        }
 
        /**
@@ -150,7 +152,7 @@ class MemoryPostReply implements PostReply {
         */
        @Override
        public Optional<Post> getPost() {
-               return database.getPost(postId);
+               return fromNullable(database.getPost(postId));
        }
 
        //