]> cat aescling's git repositories - mastodon.git/commitdiff
Fix ignoring whole status because of one invalid hashtag (#11621)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 19 Aug 2019 18:36:44 +0000 (20:36 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Aug 2019 18:36:44 +0000 (20:36 +0200)
Fix #11618

app/models/tag.rb

index 5094d973db024bda8c63e31f7f60343bb55c855d..945e3a3c621d3235c82a4b90182cca1abdb76819 100644 (file)
@@ -114,7 +114,7 @@ class Tag < ApplicationRecord
   class << self
     def find_or_create_by_names(name_or_names)
       Array(name_or_names).map(&method(:normalize)).uniq { |str| str.mb_chars.downcase.to_s }.map do |normalized_name|
-        tag = matching_name(normalized_name).first || create(name: normalized_name)
+        tag = matching_name(normalized_name).first || create!(name: normalized_name)
 
         yield tag if block_given?