From 66458c34b089cdbdb742ccddc8e6022430356952 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 2 May 2017 15:39:16 -0700 Subject: [PATCH] fixes #3014 --- app/models/artist.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/artist.rb b/app/models/artist.rb index c457bde3a..cf324d5c4 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -108,7 +108,13 @@ class Artist < ActiveRecord::Base end def domains - Post.raw_tag_match(name).pluck(:source).map {|x| map_domain(Addressable::URI.parse(x).domain)}.inject(Hash.new(0)) {|h, x| h[x] += 1; h} + Post.raw_tag_match(name).pluck(:source).map do |x| + begin + map_domain(Addressable::URI.parse(x).domain) + rescue Addressable::URI::InvalidURIError + nil + end + end.compact.inject(Hash.new(0)) {|h, x| h[x] += 1; h} end end