Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-03-24 19:29:00 +0300
committerStan Hu <stanhu@gmail.com>2016-03-25 16:30:51 +0300
commit506878970b2040be7446fc1a341d7abc61f9c6ec (patch)
treec1f1693ce133afa20ebc06c26c18ed1ae26c9900 /app
parent63c8a05bf7f18ac4093ece1f08b4b5fd8dba5fac (diff)
Don't attempt to look up an avatar in repo if repo directory does not exist
Closes #14580
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 13154eb4205..b69d5f239a0 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -877,6 +877,8 @@ class Repository
end
def avatar
+ return nil unless exists?
+
@avatar ||= cache.fetch(:avatar) do
AVATAR_FILES.find do |file|
blob_at_branch('master', file)