Permalink
Browse files

Merge pull request #1090 from lift/dw_issue_1090

Early access to S.location breaks snippet resolution
  • Loading branch information...
David Pollak
David Pollak committed May 14, 2012
2 parents 33d1e34 + 598fb03 commit c5a97b694d170762e46f84a3f1ae5adb09014509
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 c5a97b6

Please sign in to comment.