summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-03-14 20:46:34 +0100
committerBob Van Landuyt <bob@gitlab.com>2017-03-16 12:31:27 +0100
commit21c5270a39022d447b63aa0ceb527863e67804fd (patch)
treeb9254733799a87b3fd6926f356a1e271a30c64c4 /app/models
parentc4956091e182364a3e7bafecf707a3e6d6e725e2 (diff)
downloadgitlab-ce-21c5270a39022d447b63aa0ceb527863e67804fd.tar.gz
Don't try to load status when there is no commit
This could happen when the repository is missing. In which case cache needs to be cleared
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline_status.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/ci/pipeline_status.rb b/app/models/ci/pipeline_status.rb
index c41c43868f9..048047d0e34 100644
--- a/app/models/ci/pipeline_status.rb
+++ b/app/models/ci/pipeline_status.rb
@@ -37,6 +37,8 @@ module Ci
end
def load_from_commit
+ return unless commit
+
self.sha = commit.sha
self.status = commit.status
end