- protected void setCurrentSone(Request request, Sone sone) {
- Session session = getCurrentSession(request);
- session.setAttribute("Sone.CurrentSone", sone);
+ protected void setCurrentSone(ToadletContext toadletContext, Sone sone) {
+ Session session = getCurrentSession(toadletContext);
+ if (sone == null) {
+ session.removeAttribute("Sone.CurrentSone");
+ } else {
+ session.setAttribute("Sone.CurrentSone", sone.getId());
+ }