Merge pull request #3391 from wjordan/topic_embed_fix

Fix `NoMethodError` in TopicEmbed#find_remote
This commit is contained in:
Régis Hanol 2015-04-23 10:53:52 +02:00
commit 4ca5fe69cc

View file

@ -80,7 +80,7 @@ class TopicEmbed < ActiveRecord::Base
doc.search(tags.keys.join(',')).each do |node|
url_param = tags[node.name]
src = node[url_param]
unless (src.empty?)
unless (src.nil? || src.empty?)
begin
uri = URI.parse(src)
unless uri.host