Skip to content

Commit

Permalink
fix(java): Return error when trying to find a remote pom to avoid seg…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
coheigea committed Jul 31, 2024
1 parent 7024572 commit 2e12a61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/dependency/parser/java/pom/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func (p *Parser) remoteRepoRequest(repo string, paths []string) (*http.Request,
repoURL, err := url.Parse(repo)
if err != nil {
p.logger.Error("URL parse error", log.String("repo", repo))
return nil, nil
return nil, err
}

paths = append([]string{repoURL.Path}, paths...)
Expand All @@ -691,7 +691,7 @@ func (p *Parser) remoteRepoRequest(repo string, paths []string) (*http.Request,
req, err := http.NewRequest("GET", repoURL.String(), http.NoBody)
if err != nil {
logger.Debug("HTTP request failed")
return nil, nil
return nil, err
}
if repoURL.User != nil {
password, _ := repoURL.User.Password()
Expand Down

0 comments on commit 2e12a61

Please sign in to comment.