From 039e6f951ca16bd4183fb29d782dd095d2b4120a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 27 Mar 2016 23:38:46 +0200 Subject: Fix issue with unresolvable usernames --- app/helpers/application_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/helpers') 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}@#{account.acct}" + if account = account_from_mentions(Account::MENTION_RE.match(m)[1], status.mentions) + "#{m.split('@').first}@#{account.acct}" + else + m + end end.html_safe end -- cgit