Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark MediaAttachment.preview_url, blurhash as nullable #1457

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

humblehacker
Copy link
Contributor

@humblehacker humblehacker commented Jun 3, 2024

Had a payload in the wild where preview_url was null and the method that generates this value can certainly return nil if none of its conditions are met:

https://github.com/mastodon/mastodon/blob/d326ad0ed9a2e874213c9313f25b973638e4b94d/app/serializers/rest/media_attachment_serializer.rb#L30-L38

Also both TootSDK and IceCubesApp have this property as nullable.

humblehacker and others added 2 commits June 2, 2024 19:58
Had a payload in the wild where preview_url was `null` and the method that generates this value can certainly return `nil` if none of its conditions are met: https://github.com/mastodon/mastodon/blob/d326ad0ed9a2e874213c9313f25b973638e4b94d/app/serializers/rest/media_attachment_serializer.rb#L30-L38

Also both TootSDK and IceCubesApp have this property as nullable.
When the attachment has type `audio`, `blurhash` is `null`.
@humblehacker humblehacker changed the title Mark MediaAttachment.preview_url as nullable Mark MediaAttachment.preview_url, blurhash as nullable Jun 3, 2024
@humblehacker
Copy link
Contributor Author

humblehacker commented Jun 3, 2024

Also marked blurhash as nullable. Looks like these fields can be null when the attachment type is audio.

@vmstan vmstan requested a review from a team June 17, 2024 15:28
@renchap renchap merged commit ce8146c into mastodon:main Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants