fix: dont add nil cids

This commit is contained in:
Derrick Hammer 2024-03-01 04:14:11 -05:00
parent 7ec4f26142
commit 8f6e7d1acc
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -809,7 +809,9 @@ func (s *S5API) getManifestCids(cid *encoding.CID) ([]*encoding.CID, error) {
media := manifest.(*s5libmetadata.MediaMetadata) media := manifest.(*s5libmetadata.MediaMetadata)
for _, mediaType := range media.MediaTypes { for _, mediaType := range media.MediaTypes {
lo.ForEach(mediaType, func(format s5libmetadata.MediaFormat, _i int) { lo.ForEach(mediaType, func(format s5libmetadata.MediaFormat, _i int) {
if format.Cid != nil {
cids = append(cids, format.Cid) cids = append(cids, format.Cid)
}
}) })
} }