Prevent 500 after merge MR if you check remove source branch

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-12-23 11:22:12 +02:00
parent f3d7bf63f1
commit 90ed76ac3c
No known key found for this signature in database
GPG Key ID: 161B5D6A44D3D88A
1 changed files with 8 additions and 1 deletions

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]