Skip to content

Commit f521833

Browse files
committed
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 <[email protected]> kokoro-CI: kokoro <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 0a075a2 commit f521833

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/fetchdatasource/fetchdatasource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ func (ds *FetchDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, f
230230
// findUnit returns the unit with the given path in m, or nil if none.
231231
func (ds *FetchDataSource) findUnit(ctx context.Context, m *fetch.LazyModule, path string) (*internal.Unit, error) {
232232
unit, err := m.Unit(ctx, path)
233-
ds.populateUnitSubdirectories(unit, m)
234233
if err != nil {
235234
return nil, err
236235
}
236+
ds.populateUnitSubdirectories(unit, m)
237237
if ds.opts.BypassLicenseCheck {
238238
unit.IsRedistributable = true
239239
} else {

0 commit comments

Comments
 (0)