summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2018-11-23 09:30:15 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2018-11-26 17:41:40 +0800
commit3b49a7948c8f0613f2d04f270b70982f620d7c3a (patch)
treeb98c6a51dd083e092a596230d39a843ed723e5ec /lib
parent5f11daf63c8f99eafb40af91b92e1694b81e9b7d (diff)
downloadgitlab-ce-3b49a7948c8f0613f2d04f270b70982f620d7c3a.tar.gz
Prevent loading from cache if commit is nil
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/cache/ci/project_pipeline_status.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/cache/ci/project_pipeline_status.rb b/lib/gitlab/cache/ci/project_pipeline_status.rb
index 195531ef94b..1bb839a274a 100644
--- a/lib/gitlab/cache/ci/project_pipeline_status.rb
+++ b/lib/gitlab/cache/ci/project_pipeline_status.rb
@@ -47,6 +47,7 @@ module Gitlab
def load_status
return if loaded?
+ return unless commit
if has_cache?
load_from_cache
@@ -59,8 +60,6 @@ module Gitlab
end
def load_from_project
- return unless commit
-
self.sha, self.status, self.ref = commit.sha, commit.status, project.default_branch
end