Skip to content

Commit

Permalink
Fix a potential NPE (#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmos authored Feb 4, 2025
1 parent ff5a15a commit ad48c76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions warn/warn_bazel_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ var moduleToApparentRepoName func(string) string
// useApparentRepoNameIfExternal replaces the module name in a load statement with the apparent repository
// name used by the root Bazel module (if any).
func useApparentRepoNameIfExternal(load string, fileReader *FileReader) string {
if !strings.HasPrefix(load, "@") {
// Not a load from an external repository.
if !strings.HasPrefix(load, "@") || fileReader == nil {
// Not a load from an external repository or we can't load external files.
return load
}
if moduleToApparentRepoName == nil {
Expand Down

0 comments on commit ad48c76

Please sign in to comment.