From d47d323f29ca65d2d72840bc45773eb9d28241e1 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 25 Jul 2014 15:26:43 +1000 Subject: [PATCH] FIX: corrupt avatar record causing 404 --- app/controllers/user_avatars_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rb index 7e644e7bcb3..ff9ba3a1fd3 100644 --- a/app/controllers/user_avatars_controller.rb +++ b/app/controllers/user_avatars_controller.rb @@ -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