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
This commit is contained in:
Dmitriy Zaporozhets 2014-12-23 11:18:46 +00:00
commit a113ce48e3

View file

@ -66,7 +66,14 @@ module TreeHelper
end
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'
after = options[:after] || ''
from_mr = options[:from_merge_request_id]