summaryrefslogtreecommitdiff
path: root/app/helpers/tree_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r--app/helpers/tree_helper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index 329beadbd41..e32aeba5f8f 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -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]