Permalink
Browse files

Strictly evaluate user in getLoggedInUser.

  • Loading branch information...
1 parent 73c43a2 commit bdfdac7ebf2327434fbd6e99e74bd87a98c32075 @jgm committed Nov 7, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 Gitit.hs
View
@@ -268,9 +268,10 @@ instance FromData Params where
getLoggedInUser :: MonadIO m => Params -> m (Maybe String)
getLoggedInUser params = do
mbSd <- maybe (return Nothing) ( query . GetSession ) $ pSessionKey params
- return $ do
- sd <- mbSd
- Just . sessionUser $ sd
+ let user = case mbSd of
+ Nothing -> Nothing
+ Just sd -> Just $ sessionUser sd
+ return $! user
data Command = Command (Maybe String)

0 comments on commit bdfdac7

Please sign in to comment.