Permalink
Browse files

As discussed a while back, S.location is stored in a RequestVar and i…

…f the value was accessed before request state had been initialized it wasn't being retried. This will check repeatedly, but only if the RequestVar does not already hold a Full value.
  • Loading branch information...
1 parent 9c53f7e commit 598fb03518ece48e817c61d089881fce6f23c1dd @davewhittaker davewhittaker committed May 8, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 web/webkit/src/main/scala/net/liftweb/http/S.scala
@@ -386,7 +386,10 @@ trait S extends HasParams with Loggable {
private[http] object CurrentLocation extends RequestVar[Box[sitemap.Loc[_]]](request.flatMap(_.location))
- def location: Box[sitemap.Loc[_]] = CurrentLocation.is
+ def location: Box[sitemap.Loc[_]] = CurrentLocation.is or {
+ //try again in case CurrentLocation was accessed before the request was available
+ request flatMap { r => CurrentLocation(r.location) }
+ }
/**

0 comments on commit 598fb03

Please sign in to comment.