From: Takeshi Umeda Date: Wed, 14 Apr 2021 13:48:49 +0000 (+0900) Subject: Fix an error with 'multiple mentions with same username' (#16038) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=c968d22ee95fd9a37695b896cd86b7608689ead1;p=mastodon.git Fix an error with 'multiple mentions with same username' (#16038) --- diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index f13b183ad..fd6537526 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -276,7 +276,7 @@ class Formatter linkable_accounts.each do |item| same_username = item.username.casecmp(username).zero? - same_domain = item.domain.nil? ? domain.nil? : item.domain.casecmp(domain).zero? + same_domain = item.domain.nil? ? domain.nil? : item.domain.casecmp(domain)&.zero? if same_username && !same_domain same_username_hits += 1