diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index dec75ef..ac8affb 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -22,7 +22,7 @@
.input
= f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250
- - if @project.repository.branch_names.any?
+ - if @project.repository.exists? && @project.repository.branch_names.any?
.clearfix
= f.label :default_branch, "Default Branch"
.input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'})
--
libgit2 0.21.2