aboutsummaryrefslogtreecommitdiff
path: root/internal/fetchdatasource/fetchdatasource.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fetchdatasource/fetchdatasource.go')
-rw-r--r--internal/fetchdatasource/fetchdatasource.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/fetchdatasource/fetchdatasource.go b/internal/fetchdatasource/fetchdatasource.go
index 69f803eb..fe2eacca 100644
--- a/internal/fetchdatasource/fetchdatasource.go
+++ b/internal/fetchdatasource/fetchdatasource.go
@@ -181,10 +181,12 @@ func (ds *FetchDataSource) GetUnitMeta(ctx context.Context, path, requestedModul
Path: path,
ModuleInfo: module.ModuleInfo,
}
- if u := findUnit(module, path); u != nil {
- um.Name = u.Name
- um.IsRedistributable = u.IsRedistributable
+ u := findUnit(module, path)
+ if u == nil {
+ return nil, derrors.NotFound
}
+ um.Name = u.Name
+ um.IsRedistributable = u.IsRedistributable
return um, nil
}