Clean up SoneTemplatePage’s constructors
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / UnbookmarkPage.kt
index 01a0fde..ec4242b 100644 (file)
@@ -14,7 +14,7 @@ import net.pterodactylus.util.template.TemplateContext
  * Page that lets the user unbookmark a post.
  */
 class UnbookmarkPage(template: Template, webInterface: WebInterface):
-               SoneTemplatePage("unbookmark.html", template, "Page.Unbookmark.Title", webInterface, false) {
+               SoneTemplatePage("unbookmark.html", webInterface, template, "Page.Unbookmark.Title") {
 
        override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
                when {
@@ -26,8 +26,8 @@ class UnbookmarkPage(template: Template, webInterface: WebInterface):
                        }
                        freenetRequest.isPOST -> {
                                freenetRequest.parameters["post", 36]
-                                               .let(webInterface.core::getPost)
-                                               .also(webInterface.core::unbookmarkPost)
+                                               ?.let(webInterface.core::getPost)
+                                               ?.also(webInterface.core::unbookmarkPost)
                                throw RedirectException(freenetRequest.parameters["returnPage", 256])
                        }
                }