lib/image_scraper/util.rb in rcarvalho-image_scraper-0.1.8.7 vs lib/image_scraper/util.rb in rcarvalho-image_scraper-0.1.8.8
- old
+ new
@@ -10,10 +10,10 @@
# based on original url (http://example.com/about),
# self.absolute_url gives
# 'http://example.com/style.css
# but should get:
# 'http://example.com/about/style.css
- URI.parse(url).merge(URI.parse asset.to_s).to_s
+ URI.parse(url).merge(URI.parse asset.to_s).to_s rescue nil
end
def self.domain(url)
uri = URI.parse(url)
"#{uri.scheme}://#{uri.host}"