FIX: don't crash from observer if user record is bad
This commit is contained in:
parent
6b10c4dc54
commit
e1be1e5fd9
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue