rework media processing a little bit (#191)

* rework media processing a little bit

* review changes
This commit is contained in:
tobi
2021-09-04 14:02:01 +02:00
committed by GitHub
parent ff05046df7
commit 2b14b20802
13 changed files with 486 additions and 166 deletions

View File

@@ -384,10 +384,7 @@ func ExtractAttachment(i Attachmentable) (*gtsmodel.MediaAttachment, error) {
attachment.RemoteURL = attachmentURL.String()
mediaType := i.GetActivityStreamsMediaType()
if mediaType == nil {
return nil, errors.New("no media type")
}
if mediaType.Get() == "" {
if mediaType == nil || mediaType.Get() == "" {
return nil, errors.New("no media type")
}
attachment.File.ContentType = mediaType.Get()