check if profile exists before fetching profile photo

This commit is contained in:
danielvincent 2010-11-23 14:49:32 -08:00
parent 7c6bc7f7ea
commit 0b36e955fe

View file

@ -67,7 +67,7 @@ module ApplicationHelper
end
def image_or_default(person)
image_location = person.profile.image_url
image_location = person.profile.image_url if person.profile
image_location ||= "/images/user/default.png"
image_location
end