Return an optional Sone from the current session.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / UnlikePage.java
index d7e9acb..3ba2e4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - UnlikePage.java - Copyright © 2010–2012 David Roden
+ * Sone - UnlikePage.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
@@ -57,7 +57,7 @@ public class UnlikePage extends SoneTemplatePage {
                        String type = request.getHttpRequest().getPartAsStringFailsafe("type", 16);
                        String id = request.getHttpRequest().getPartAsStringFailsafe(type, 36);
                        String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
-                       Sone currentSone = getCurrentSone(request.getToadletContext());
+                       Sone currentSone = getCurrentSone(request.getToadletContext()).get();
                        if ("post".equals(type)) {
                                currentSone.removeLikedPostId(id);
                        } else if ("reply".equals(type)) {