mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: User#user_avatar
may be nil.
This commit is contained in:
parent
67aecff59c
commit
34342ad0d8
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ class UserAvatarsController < ApplicationController
|
|||
return redirect_to cdn_path(avatar_url)
|
||||
end
|
||||
|
||||
upload = Upload.find_by(id: upload_id) if user.user_avatar.contains_upload?(upload_id)
|
||||
upload = Upload.find_by(id: upload_id) if user&.user_avatar&.contains_upload?(upload_id)
|
||||
upload ||= user.uploaded_avatar if user.uploaded_avatar_id == upload_id
|
||||
|
||||
if user.uploaded_avatar && !upload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue