mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
fix(metadb): fix unexpected panic when dereferencing map fields (#1993)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -406,6 +406,10 @@ func GetFullImageMetaFromProto(tag string, protoRepoMeta *proto_go.RepoMeta, pro
|
||||
|
||||
func GetFullManifestData(protoRepoMeta *proto_go.RepoMeta, manifestData []mTypes.ManifestData,
|
||||
) []mTypes.FullManifestMeta {
|
||||
if protoRepoMeta == nil {
|
||||
return []mTypes.FullManifestMeta{}
|
||||
}
|
||||
|
||||
results := []mTypes.FullManifestMeta{}
|
||||
|
||||
for i := range manifestData {
|
||||
@@ -421,6 +425,10 @@ func GetFullManifestData(protoRepoMeta *proto_go.RepoMeta, manifestData []mTypes
|
||||
}
|
||||
|
||||
func GetRepoMeta(protoRepoMeta *proto_go.RepoMeta) mTypes.RepoMeta {
|
||||
if protoRepoMeta == nil {
|
||||
return mTypes.RepoMeta{}
|
||||
}
|
||||
|
||||
repoDownloads := int32(0)
|
||||
|
||||
for _, descriptor := range protoRepoMeta.Tags {
|
||||
|
||||
Reference in New Issue
Block a user