mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
.getOrElse(None) => .flatten
This commit is contained in:
@@ -47,7 +47,7 @@ trait AccountService {
|
|||||||
case _ => None
|
case _ => None
|
||||||
}
|
}
|
||||||
case account if (!account.isGroupAccount && account.password == sha1(password)) => Some(account)
|
case account if (!account.isGroupAccount && account.password == sha1(password)) => Some(account)
|
||||||
} getOrElse None
|
}.flatten
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ object RepositoryCreationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def getCreationError(owner: String, repository: String): Option[String] = {
|
def getCreationError(owner: String, repository: String): Option[String] = {
|
||||||
Option(Creating.remove(s"${owner}/${repository}")).getOrElse(None)
|
Option(Creating.remove(s"${owner}/${repository}")).flatten
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,7 +766,8 @@ trait RepositoryService {
|
|||||||
JGitUtil.getContentFromId(git, file.id, true).collect {
|
JGitUtil.getContentFromId(git, file.id, true).collect {
|
||||||
case bytes if FileUtil.isText(bytes) => StringUtil.convertFromByteArray(bytes)
|
case bytes if FileUtil.isText(bytes) => StringUtil.convertFromByteArray(bytes)
|
||||||
}
|
}
|
||||||
} getOrElse None
|
}
|
||||||
|
.flatten
|
||||||
} getOrElse ""
|
} getOrElse ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user