Skip to content

Commit

Permalink
Handle nil tags indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorvsk committed Nov 19, 2023
1 parent 2f6a0c3 commit cee6ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/nostr/nip1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def init_searchable_tags
searchable_tags.new(name: "d", value: "")
end
tag_with_value_only = tags.map { |t| t[..1] }.reject(&:blank?) # TODO: cover empty tag with spec
unique_tags = tag_with_value_only.uniq { |tag| tag[0] + tag[1..].map(&:downcase).sort.join }
unique_tags = tag_with_value_only.uniq { |tag| tag[0] + tag[1..].map(&:to_s).map(&:downcase).sort.join } # We can have nil in tag value
unique_tags.each do |tag|
tag_name, tag_value = tag
tag_value_too_long = tag_value && tag.second.size > RELAY_CONFIG.max_searchable_tag_value_length
Expand Down

0 comments on commit cee6ea9

Please sign in to comment.