FIX: Sometimes `contents` is nil, don't break in that case.
This commit is contained in:
parent
942f18143c
commit
edae9d7ad9
|
@ -20,6 +20,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||||
if SiteSetting.embed_truncate
|
if SiteSetting.embed_truncate
|
||||||
contents = first_paragraph_from(contents)
|
contents = first_paragraph_from(contents)
|
||||||
end
|
end
|
||||||
|
contents ||= ''
|
||||||
contents << imported_from_html(url)
|
contents << imported_from_html(url)
|
||||||
|
|
||||||
url = normalize_url(url)
|
url = normalize_url(url)
|
||||||
|
|
Loading…
Reference in New Issue