fix: player issues

This commit is contained in:
yanghao05
2025-04-29 14:43:19 +08:00
parent 0c56ff0ff3
commit 1dbdfba3cb
2 changed files with 3 additions and 2 deletions

View File

@@ -165,7 +165,7 @@ func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, er
}
for _, asset := range post.Assets.Data {
if asset.Type == "video/mp4" && asset.Metas.Short == preview {
if asset.Type == "video/mp4" && asset.Metas != nil && asset.Metas.Short == preview {
media, err := models.Medias.GetByID(ctx.Context(), asset.Media)
if err != nil {
return nil, err