diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-03-17 20:38:35 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-03-17 20:46:17 +0300 |
commit | 6048910aeef723faa535ce7ba6bb88a5e3360df9 (patch) | |
tree | 5985b17519a5074382933772693b545b6e0fd188 /app/views/layouts/header | |
parent | d1fd2cb8c1cad5299555c3e9cff54e1d8cde44c0 (diff) |
Prevent a 500 when a repository's root_ref is nil
Closes #14259
Diffstat (limited to 'app/views/layouts/header')
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 6 |
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)}"; |