mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
rework media processing a little bit (#191)
* rework media processing a little bit * review changes
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user