From: abcang Date: Mon, 14 May 2018 10:51:53 +0000 (+0900) Subject: Call media.present? because media may be nil (#7474) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=3793e598d0dd1b0db0c66ba1f35509dc8adf42c0;p=mastodon.git Call media.present? because media may be nil (#7474) --- diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 8a1a120c3..7a3576e2d 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -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,