Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f5d7a617
Commit
f5d7a617
authored
Dec 02, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes ActionView::Template::Error: undefined method `text?` for nil:NilClass
parent
2394afe4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
changelogs/unreleased/25251-actionview-template-error-undefined-method-text-for-nil-nilclass.yml
...template-error-undefined-method-text-for-nil-nilclass.yml
+5
-0
lib/gitlab/diff/file_collection/merge_request_diff.rb
lib/gitlab/diff/file_collection/merge_request_diff.rb
+1
-1
spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb
...ib/gitlab/diff/file_collection/merge_request_diff_spec.rb
+8
-0
No files found.
changelogs/unreleased/25251-actionview-template-error-undefined-method-text-for-nil-nilclass.yml
0 → 100644
View file @
f5d7a617
---
title
:
'
Fixes
"ActionView::Template::Error:
undefined
method
`text?`
for
nil:NilClass"
on
MR
pages'
merge_request
:
author
:
lib/gitlab/diff/file_collection/merge_request_diff.rb
View file @
f5d7a617
...
@@ -61,7 +61,7 @@ module Gitlab
...
@@ -61,7 +61,7 @@ module Gitlab
end
end
def
cacheable?
(
diff_file
)
def
cacheable?
(
diff_file
)
@merge_request_diff
.
present?
&&
diff_file
.
blob
.
text?
@merge_request_diff
.
present?
&&
diff_file
.
blob
&&
diff_file
.
blob
.
text?
end
end
def
cache_key
def
cache_key
...
...
spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb
View file @
f5d7a617
...
@@ -10,4 +10,12 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do
...
@@ -10,4 +10,12 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do
described_class
.
new
(
merge_request
.
merge_request_diff
,
diff_options:
nil
).
diff_files
described_class
.
new
(
merge_request
.
merge_request_diff
,
diff_options:
nil
).
diff_files
end
end
it
'does not hightlight file if blob is not accessable'
do
allow_any_instance_of
(
Gitlab
::
Diff
::
File
).
to
receive
(
:blob
).
and_return
(
nil
)
expect_any_instance_of
(
Gitlab
::
Diff
::
File
).
not_to
receive
(
:highlighted_diff_lines
)
described_class
.
new
(
merge_request
.
merge_request_diff
,
diff_options:
nil
).
diff_files
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment