1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-28 06:48:28 +09:00

Call media.present? because media may be nil (#7474)

This commit is contained in:
abcang 2018-05-14 19:51:53 +09:00 committed by Eugen Rochko
parent 42a1231245
commit 3793e598d0

View File

@ -22,7 +22,7 @@ class PostStatusService < BaseService
media = validate_media!(options[:media_ids])
status = nil
text = options.delete(:spoiler_text) if text.blank? && options[:spoiler_text].present?
text = '.' if text.blank? && !media.empty?
text = '.' if text.blank? && media.present?
ApplicationRecord.transaction do
status = account.statuses.create!(text: text,