* VRFS-1323 - protect against null entries

This commit is contained in:
Seth Call 2014-03-03 20:45:24 -06:00
parent aa62cc7d2a
commit 608f4b2b13
1 changed files with 2 additions and 2 deletions

View File

@ -206,10 +206,10 @@ class UsersController < ApplicationController
Slide.new("bands", "web/carousel_bands.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s")
]
@promo_buzz = Promotional.where(:type => 'JamRuby::PromoBuzz', :aasm_state => :active).order(:position)
@promo_buzz = Promotional.where(:type => 'JamRuby::PromoBuzz', :aasm_state => :active).where('latest_id IS NOT NULL').order(:position)
if Rails.application.config.use_promos_on_homepage
@promo_latest = Promotional.where(:type => 'JamRuby::PromoLatest', :aasm_state => :active).order(:position).limit(10)
@promo_latest = Promotional.where(:type => 'JamRuby::PromoLatest', :aasm_state => :active).where('latest_id IS NOT NULL').order(:position).limit(10)
else
@promo_latest, start = Feed.index(nil, limit: 10)
end