Merge branch 'handle-bad-head' into 'master'

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`.

See merge request !1433
This commit is contained in:
Dmitriy Zaporozhets 2015-09-25 09:29:26 +00:00
commit 718817fd8f
1 changed files with 1 additions and 1 deletions

View File

@ -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