From 3793e598d0dd1b0db0c66ba1f35509dc8adf42c0 Mon Sep 17 00:00:00 2001 From: abcang Date: Mon, 14 May 2018 19:51:53 +0900 Subject: Call media.present? because media may be nil (#7474) --- app/services/post_status_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit