Fix an error in ReadableRepositoryAuthenticator when repository does not exist.

This commit is contained in:
takezoe
2013-06-06 21:39:50 +09:00
parent faba787e0d
commit 62912f5416

View File

@@ -85,8 +85,10 @@ trait ReadableRepositoryAuthenticator { self: ControllerBase with RepositoryServ
private def authenticate(action: => Any) = {
{
val paths = request.getRequestURI.split("/")
val repository = getRepository(paths(1), paths(2), servletContext)
if(repository.get.repository.repositoryType == RepositoryService.Public){
getRepository(paths(1), paths(2), servletContext) match {
case None => NotFound()
case Some(repository) =>
if(repository.repository.repositoryType == RepositoryService.Public){
action
} else {
context.loginAccount match {
@@ -99,3 +101,4 @@ trait ReadableRepositoryAuthenticator { self: ControllerBase with RepositoryServ
}
}
}
}