Skip to content

A platform for community discussion. Free, open, simple.

FIX: Return blank avatar when downloading an avatar is not possible due to file size

romanrizzia411806551db
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