添加判空
This commit is contained in:
parent
c2ccf6a1f8
commit
c42a63ea4e
|
@ -15,13 +15,13 @@ module Mobile
|
|||
when :img_url
|
||||
url_to_avatar(u)
|
||||
when :gender
|
||||
u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
|
||||
u.nil? || u.user_extensions.nil? || u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
|
||||
when :work_unit
|
||||
get_user_work_unit u
|
||||
when :location
|
||||
get_user_location u
|
||||
when :brief_introduction
|
||||
u.user_extensions.brief_introduction
|
||||
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue