Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / DeleteSonePage.java
index bbf533f..aa824fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - DeleteSonePage.java - Copyright © 2010 David Roden
+ * Sone - DeleteSonePage.java - Copyright © 2010–2013 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
@@ -56,7 +56,7 @@ public class DeleteSonePage extends SoneTemplatePage {
                super.processTemplate(request, templateContext);
                if (request.getMethod() == Method.POST) {
                        if (request.getHttpRequest().isPartSet("deleteSone")) {
-                               Sone currentSone = getCurrentSone(request.getToadletContext());
+                               Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                                webInterface.getCore().deleteSone(currentSone);
                        }
                        throw new RedirectException("index.html");