From bbfa5c7df18c50b02fc290d46dc8f2ec34dd9889 Mon Sep 17 00:00:00 2001 From: Will Jordan Date: Wed, 22 Apr 2015 16:52:02 -0700 Subject: [PATCH] Fix `NoMethodError` in TopicEmbed#find_remote Stop TopicEmbed#find_remote from generating `NoMethodError: undefined method `empty?' for nil:NilClass` exceptions --- app/models/topic_embed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/topic_embed.rb b/app/models/topic_embed.rb index c9dcc09bf..294f86ff2 100644 --- a/app/models/topic_embed.rb +++ b/app/models/topic_embed.rb @@ -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