]> cat aescling's git repositories - mastodon.git/commitdiff
Call media.present? because media may be nil (#7474)
authorabcang <abcang1015@gmail.com>
Mon, 14 May 2018 10:51:53 +0000 (19:51 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 14 May 2018 10:51:53 +0000 (12:51 +0200)
app/services/post_status_service.rb

index 8a1a120c38cd660f509548fc633744a25e6b85a8..7a3576e2dea9c895837e20ee9bf9eee6ac605ab4 100644 (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,