From 3b49a7948c8f0613f2d04f270b70982f620d7c3a Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Fri, 23 Nov 2018 09:30:15 +0800 Subject: [PATCH] Prevent loading from cache if commit is nil --- lib/gitlab/cache/ci/project_pipeline_status.rb | 3 +-- 1 file changed, 1 insertion(+), 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