Browse Source

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

pull/4/head
abcang 6 years ago
committed by Eugen Rochko
parent
commit
3793e598d0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/services/post_status_service.rb

+ 1
- 1
app/services/post_status_service.rb 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,

Loading…
Cancel
Save