Skip to content
This repository
Browse code

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...
commit 598fb03518ece48e817c61d089881fce6f23c1dd 1 parent 9c53f7e
Dave Whittaker authored May 08, 2012
5  web/webkit/src/main/scala/net/liftweb/http/S.scala
@@ -386,7 +386,10 @@ trait S extends HasParams with Loggable {
386 386
 
387 387
   private[http] object CurrentLocation extends RequestVar[Box[sitemap.Loc[_]]](request.flatMap(_.location))
388 388
 
389  
-  def location: Box[sitemap.Loc[_]] = CurrentLocation.is
  389
+  def location: Box[sitemap.Loc[_]] = CurrentLocation.is or {
  390
+    //try again in case CurrentLocation was accessed before the request was available
  391
+    request flatMap { r => CurrentLocation(r.location) }
  392
+  }
390 393
 
391 394
 
392 395
   /**

0 notes on commit 598fb03

Please sign in to comment.
Something went wrong with that request. Please try again.