]> cat aescling's git repositories - mastodon.git/commitdiff
Fix an error with 'multiple mentions with same username' (#16038)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Wed, 14 Apr 2021 13:48:49 +0000 (22:48 +0900)
committerGitHub <noreply@github.com>
Wed, 14 Apr 2021 13:48:49 +0000 (15:48 +0200)
app/lib/formatter.rb

index f13b183ad2c4150341780fa9ed0b42543aa1e23c..fd653752627374180b39f975aea002b615058307 100644 (file)
@@ -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