Commit 04de85a9 authored by Stan Hu's avatar Stan Hu

Fix Error 500 occuring with repositories that have a bad HEAD

A repository could have objects but no valid HEAD, causing
`project.commit` to be `nil`.
parent 1fef314d
......@@ -18,7 +18,7 @@
= project.name
.project-controls
- if ci && !project.empty_repo?
- if ci && !project.empty_repo? && project.commit
- if ci_commit = project.ci_commit(project.commit.sha)
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment