From edae9d7ad92178de85deae7ecc8aa81f6b174dc3 Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Wed, 6 May 2015 12:40:24 -0400
Subject: [PATCH] FIX: Sometimes `contents` is nil, don't break in that case.

---
 app/models/topic_embed.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/models/topic_embed.rb b/app/models/topic_embed.rb
index 294f86ff2..fa8008703 100644
--- a/app/models/topic_embed.rb
+++ b/app/models/topic_embed.rb
@@ -20,6 +20,7 @@ class TopicEmbed < ActiveRecord::Base
     if SiteSetting.embed_truncate
       contents = first_paragraph_from(contents)
     end
+    contents ||= ''
     contents << imported_from_html(url)
 
     url = normalize_url(url)