diff options
| author | Heinrich Lee Yu <heinrich@gitlab.com> | 2018-11-23 09:30:15 +0800 |
|---|---|---|
| committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2018-11-26 17:41:40 +0800 |
| commit | 3b49a7948c8f0613f2d04f270b70982f620d7c3a (patch) | |
| tree | b98c6a51dd083e092a596230d39a843ed723e5ec | |
| parent | 5f11daf63c8f99eafb40af91b92e1694b81e9b7d (diff) | |
| download | gitlab-ce-3b49a7948c8f0613f2d04f270b70982f620d7c3a.tar.gz | |
Prevent loading from cache if commit is nil
| -rw-r--r-- | lib/gitlab/cache/ci/project_pipeline_status.rb | 3 |
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 |
