Commit a113ce48 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-500-after-merge' into 'master'

Fix 500 on MR diff page after merge and branch was removed

Fixes #1847

See merge request !1345
parents 554719d9 90ed76ac
...@@ -66,7 +66,14 @@ module TreeHelper ...@@ -66,7 +66,14 @@ module TreeHelper
end end
def edit_blob_link(project, ref, path, options = {}) def edit_blob_link(project, ref, path, options = {})
if project.repository.blob_at(ref, path).text? blob =
begin
project.repository.blob_at(ref, path)
rescue
nil
end
if blob && blob.text?
text = 'Edit' text = 'Edit'
after = options[:after] || '' after = options[:after] || ''
from_mr = options[:from_merge_request_id] from_mr = options[:from_merge_request_id]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment