Return nullable Post instead of Optional
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / PostReplyImpl.java
index 136d6a0..3571172 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - PostReplyImpl.java - Copyright © 2010–2015 David Roden
+ * Sone - PostReplyImpl.java - Copyright © 2010–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.data.impl;
 
+import static com.google.common.base.Optional.fromNullable;
+
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.PostReply;
 import net.pterodactylus.sone.database.PostProvider;
@@ -78,7 +80,7 @@ public class PostReplyImpl extends ReplyImpl<PostReply> implements PostReply {
         */
        @Override
        public Optional<Post> getPost() {
-               return postProvider.getPost(postId);
+               return fromNullable(postProvider.getPost(postId));
        }
 
 }