about summary refs log tree commit diff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-27 23:38:46 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-03-27 23:38:46 +0200
commit039e6f951ca16bd4183fb29d782dd095d2b4120a (patch)
tree0c4d67283247092bf02cbf558877bfe2f91f3014 /app/helpers/application_helper.rb
parent882c94a6bf825fb125ed3229db8653d076f1d774 (diff)
Fix issue with unresolvable usernames
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index a56bbe59e..e2baecede 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -38,8 +38,11 @@ module ApplicationHelper
 
   def linkify(status)
     auto_link(HTMLEntities.new.encode(status.text), link: :urls, html: { rel: 'nofollow noopener' }).gsub(Account::MENTION_RE) do |m|
-      account = account_from_mentions(Account::MENTION_RE.match(m)[1], status.mentions)
-      "#{m.split('@').first}<a href=\"#{url_for_target(account)}\" class=\"mention\">@<span>#{account.acct}</span></a>"
+      if account = account_from_mentions(Account::MENTION_RE.match(m)[1], status.mentions)
+        "#{m.split('@').first}<a href=\"#{url_for_target(account)}\" class=\"mention\">@<span>#{account.acct}</span></a>"
+      else
+        m
+      end
     end.html_safe
   end