diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-16 00:47:23 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-22 11:13:09 -0800 |
commit | 4949f40ac4fc24cf34908e2f0aeba572102b30b2 (patch) | |
tree | 5f4dfdc8a639a5b5e96dbbea11434789e2a712cb /app/views/search/results/_issue.html.haml | |
parent | 1cf45407d3be9e9767d27e55b6f3e2e0d8dea36f (diff) | |
download | gitlab-ce-4949f40ac4fc24cf34908e2f0aeba572102b30b2.tar.gz |
Fix Error 500 when doing a search in dashboard before visiting any project
If a search turned up an issue, under certain conditions you would see this error:
```
ActionView::Template::Error (undefined method `path_with_namespace' for nil:NilClass):
6: - if issue.description.present?
7: .description.term
8: = preserve do
9: = search_md_sanitize(markdown(issue.description))
10: %span.light
11: #{issue.project.name_with_namespace}
12: - if issue.closed?
lib/gitlab/markdown/upload_link_filter.rb:36:in `build_url'
lib/gitlab/markdown/upload_link_filter.rb:31:in `process_link_attr'
lib/gitlab/markdown/upload_link_filter.rb:18:in `block in call'
lib/gitlab/markdown/upload_link_filter.rb:17:in `call'
lib/gitlab/markdown.rb:127:in `gfm'
lib/gitlab/markdown.rb:24:in `render'
app/helpers/gitlab_markdown_helper.rb:61:in `markdown'
app/views/search/results/_issue.html.haml:9:in `block in _app_views_search_results__issue_html_haml__4127460390996300432_59973760'
app/views/search/results/_issue.html.haml:8:in `_app_views_search_results__issue_html_haml__4127460390996300432_59973760'
app/views/search/_results.html.haml:20:in `_app_views_search__results_html_haml__589475855773452465_61761440'
app/views/search/show.html.haml:5:in `_app_views_search_show_html_haml___1852335078065998536_69780120'
```
Diffstat (limited to 'app/views/search/results/_issue.html.haml')
-rw-r--r-- | app/views/search/results/_issue.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/search/results/_issue.html.haml b/app/views/search/results/_issue.html.haml index ce8ddff9556..45d700781f3 100644 --- a/app/views/search/results/_issue.html.haml +++ b/app/views/search/results/_issue.html.haml @@ -6,7 +6,7 @@ - if issue.description.present? .description.term = preserve do - = search_md_sanitize(markdown(issue.description)) + = search_md_sanitize(markdown(issue.description, { project: issue.project })) %span.light #{issue.project.name_with_namespace} - if issue.closed? |