mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 16:32:25 -05:00
[bugfix] Fix nil ptr for audio attachments with no preview in web (#4227)
Fixes a cheeky little nil pointer bug that I wrote. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4227 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
5097e6d278
commit
6d511d696b
1 changed files with 4 additions and 3 deletions
|
|
@ -235,9 +235,10 @@ func (o *OGMeta) WithStatus(status *apimodel.WebStatus) *OGMeta {
|
|||
// Add this to our gathered entries.
|
||||
ogMedias = append(ogMedias, ogMedia)
|
||||
|
||||
if a.Type != "image" {
|
||||
// Add static/thumbnail
|
||||
// for non-images.
|
||||
// Add static/thumb for non-images
|
||||
// (eg., audio files) only if they
|
||||
// have a preview url set.
|
||||
if a.Type != "image" && a.PreviewURL != nil {
|
||||
ogMedias = append(
|
||||
ogMedias,
|
||||
OGMedia{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue