mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-17 08:03:53 -05:00
Fix crash when posting with a CW but no text nor media
This commit is contained in:
parent
faa56643b8
commit
d98fabf2ee
@ -50,11 +50,11 @@ class PostStatusService < BaseService
|
|||||||
def preprocess_attributes!
|
def preprocess_attributes!
|
||||||
if @text.blank? && @options[:spoiler_text].present?
|
if @text.blank? && @options[:spoiler_text].present?
|
||||||
@text = '.'
|
@text = '.'
|
||||||
if @media.find(&:video?) || @media.find(&:gifv?)
|
if @media&.find(&:video?) || @media&.find(&:gifv?)
|
||||||
@text = '📹'
|
@text = '📹'
|
||||||
elsif @media.find(&:audio?)
|
elsif @media&.find(&:audio?)
|
||||||
@text = '🎵'
|
@text = '🎵'
|
||||||
elsif @media.find(&:image?)
|
elsif @media&.find(&:image?)
|
||||||
@text = '🖼'
|
@text = '🖼'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user