diff options
| author | Jonathan Amsterdam <jba@google.com> | 2025-04-15 14:48:49 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2025-04-17 08:20:26 -0700 |
| commit | f5218331965c6e942d40da4b09d13cdb474a3329 (patch) | |
| tree | 13b6795f838b122929db6ee150b73bec72abdb51 /internal/fetchdatasource/fetchdatasource.go | |
| parent | 0a075a2cae6ac8ff829d0d7c7841d064d6833167 (diff) | |
| download | go-x-pkgsite-f5218331965c6e942d40da4b09d13cdb474a3329.tar.xz | |
internal/fetchdatasource: check for error earlier
Check for an error before using the other return value.
Fixes golang/go#73377.
Change-Id: Idfe6b53a179aac7f4b49ccf009150fa09bef8956
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/665638
Reviewed-by: Michael Matloob <matloob@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'internal/fetchdatasource/fetchdatasource.go')
| -rw-r--r-- | internal/fetchdatasource/fetchdatasource.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/fetchdatasource/fetchdatasource.go b/internal/fetchdatasource/fetchdatasource.go index 34a52daf..f36be0c1 100644 --- a/internal/fetchdatasource/fetchdatasource.go +++ b/internal/fetchdatasource/fetchdatasource.go @@ -230,10 +230,10 @@ func (ds *FetchDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, f // findUnit returns the unit with the given path in m, or nil if none. func (ds *FetchDataSource) findUnit(ctx context.Context, m *fetch.LazyModule, path string) (*internal.Unit, error) { unit, err := m.Unit(ctx, path) - ds.populateUnitSubdirectories(unit, m) if err != nil { return nil, err } + ds.populateUnitSubdirectories(unit, m) if ds.opts.BypassLicenseCheck { unit.IsRedistributable = true } else { |
