Fix NoMethodError in TopicEmbed#find_remote

Stop TopicEmbed#find_remote from generating `NoMethodError: undefined method `empty?' for nil:NilClass` exceptions
This commit is contained in:
Will Jordan 2015-04-22 16:52:02 -07:00
parent 388f51eed7
commit bbfa5c7df1

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