Return nullable Post instead of Optional
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / CreateReplyPage.kt
index a6c58e4..a3fc1f3 100644 (file)
@@ -22,7 +22,7 @@ class CreateReplyPage(template: Template, webInterface: WebInterface):
                                templateContext["errorTextEmpty"] = true
                                return
                        }
-                       val post = webInterface.core.getPost(postId).orNull() ?: throw RedirectException("noPermission.html")
+                       val post = webInterface.core.getPost(postId) ?: throw RedirectException("noPermission.html")
                        val sender = webInterface.core.getLocalSone(freenetRequest.httpRequest.getPartAsStringFailsafe("sender", 43)) ?: getCurrentSone(freenetRequest.toadletContext)
                        webInterface.core.createReply(sender, post, TextFilter.filter(freenetRequest.httpRequest.getHeader("Host"), text))
                        throw RedirectException(returnPage)