about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-03-03 06:45:46 +0100
committerGitHub <noreply@github.com>2022-03-03 06:45:46 +0100
commit085f286750e50fe7dca4f005cefac48da0eda7cd (patch)
tree4f90cec0e89e9446ff0c3136139feef170e051bd /app/lib/formatter.rb
parent54d4ece7432a34a2ba24617851f04801e5a389d8 (diff)
Fix returning empty `<p>` tag for blank account `note` in REST API (#17687)
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 6f02d669a..b6a13163d 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -57,6 +57,8 @@ class Formatter
   end
 
   def simplified_format(account, **options)
+    return '' if account.note.blank?
+
     html = account.local? ? linkify(account.note) : reformat(account.note)
     html = encode_custom_emojis(html, account.emojis, options[:autoplay]) if options[:custom_emojify]
     html.html_safe # rubocop:disable Rails/OutputSafety