Skip to content

Commit

Permalink
bug: 修复GitRepoInterceptor不生效 #2755
Browse files Browse the repository at this point in the history
  • Loading branch information
felixncheng authored Nov 21, 2024
1 parent 2bdbcc2 commit 01210ad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class ProxyInterceptor : HandlerInterceptor {

override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE) ?: return false
val repo = ArtifactContextHolder.getRepoDetail()!!
val repo = ArtifactContextHolder.getRepoDetailOrNull()
// 只有PROXY类型的仓库才进行拦截
if (repo.category != RepositoryCategory.PROXY) {
if (repo == null || repo.category != RepositoryCategory.PROXY) {
return true
}
val projectId = repo.projectId
Expand Down

0 comments on commit 01210ad

Please sign in to comment.