X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2Fmemory%2FMemoryPostReply.java;h=40f07759adfe6e6882bd69051dc307473cce0ce8;hp=2fc8a88953547e6a4936a438ef21483426b465b4;hb=179e7da4d8d8a474d0b622d60b5f5d32d6ab4052;hpb=8e313509a42a8c638fcac018dd73dd975bf9cb68 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 2fc8a88..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–2016 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 { @@ -150,7 +150,7 @@ class MemoryPostReply implements PostReply { */ @Override public Optional getPost() { - return database.getPost(postId); + return fromNullable(database.getPost(postId)); } //