From a411806551dbbc46c27b7df3579b9b2b0c7214b6 Mon Sep 17 00:00:00 2001 From: romanrizzi Date: Tue, 22 Oct 2019 12:05:36 -0300 Subject: [PATCH] FIX: Return blank avatar when downloading an avatar is not possible due to file size --- app/controllers/user_avatars_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rb index 288fb8bc3f2..13fc1f8cd93 100644 --- a/app/controllers/user_avatars_controller.rb +++ b/app/controllers/user_avatars_controller.rb @@ -160,6 +160,9 @@ class UserAvatarsController < ApplicationController follow_redirect: true, read_timeout: 10 ) + + return render_blank if tmp.nil? + FileUtils.mv tmp.path, path end