FIX: don't crash from observer if user record is bad

This commit is contained in:
Sam 2014-11-20 16:08:06 +11:00
parent 6b10c4dc54
commit e1be1e5fd9
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class SearchObserver < ActiveRecord::Observer
end
end
if obj.class == User && (obj.username_changed? || obj.name_changed?)
SearchObserver.update_users_index(obj.id, obj.username_lower, obj.name.downcase)
SearchObserver.update_users_index(obj.id, obj.username_lower || '', obj.name ? obj.name.downcase : '')
end
if obj.class == Topic && obj.title_changed?