FIX: corrupt avatar record causing 404

This commit is contained in:
Sam 2014-07-25 15:26:43 +10:00
parent 354d40a6ea
commit d47d323f29
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class UserAvatarsController < ApplicationController
return render_dot unless version > 0 && user_avatar = user.user_avatar
upload = Upload.find(version) if user_avatar.contains_upload?(version)
upload = Upload.find_by(id: version) if user_avatar.contains_upload?(version)
upload ||= user.uploaded_avatar if user.uploaded_avatar_id == version
if user.uploaded_avatar && !upload