summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-03-17 13:38:35 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-03-17 13:46:17 -0400
commit6048910aeef723faa535ce7ba6bb88a5e3360df9 (patch)
tree5985b17519a5074382933772693b545b6e0fd188
parentd1fd2cb8c1cad5299555c3e9cff54e1d8cde44c0 (diff)
downloadgitlab-ce-rs-issue-14259.tar.gz
Prevent a 500 when a repository's root_ref is nilrs-issue-14259
Closes #14259
-rw-r--r--app/views/layouts/header/_default.html.haml6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 77d01a7736c..f3090b96702 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -46,6 +46,8 @@
%h1.title= title
= render 'shared/outdated_browser'
+
- if @project && !@project.empty_repo?
- :javascript
- var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, @ref || @project.repository.root_ref)}";
+ - if ref = @ref || @project.repository.root_ref
+ :javascript
+ var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, ref)}";