Commit b21e3e528ec337e9a404e2d2f89bf2a4963e6bd6

Authored by Braulio Bhavamitra
1 parent 71728d99

Fix crash from nil content

Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
app/models/external_feed.rb
@@ -11,6 +11,7 @@ class ExternalFeed < ActiveRecord::Base @@ -11,6 +11,7 @@ class ExternalFeed < ActiveRecord::Base
11 } 11 }
12 12
13 def add_item(title, link, date, content) 13 def add_item(title, link, date, content)
  14 + return if content.blank?
14 doc = Hpricot(content) 15 doc = Hpricot(content)
15 doc.search('*').each do |p| 16 doc.search('*').each do |p|
16 if p.instance_of? Hpricot::Elem 17 if p.instance_of? Hpricot::Elem