mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-25 06:13:43 +01:00
Fix crash when posting with a CW but no text nor media
This commit is contained in:
parent
faa56643b8
commit
d98fabf2ee
1 changed files with 3 additions and 3 deletions
|
@ -50,11 +50,11 @@ class PostStatusService < BaseService
|
|||
def preprocess_attributes!
|
||||
if @text.blank? && @options[:spoiler_text].present?
|
||||
@text = '.'
|
||||
if @media.find(&:video?) || @media.find(&:gifv?)
|
||||
if @media&.find(&:video?) || @media&.find(&:gifv?)
|
||||
@text = '📹'
|
||||
elsif @media.find(&:audio?)
|
||||
elsif @media&.find(&:audio?)
|
||||
@text = '🎵'
|
||||
elsif @media.find(&:image?)
|
||||
elsif @media&.find(&:image?)
|
||||
@text = '🖼'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue