Fix #match? on nil.
This commit is contained in:
parent
13b79e7b1a
commit
3d0fae4621
@ -17,7 +17,7 @@ module RuboCop
|
|||||||
url_node = stanza.stanza_node.first_argument
|
url_node = stanza.stanza_node.first_argument
|
||||||
url = url_node.str_content
|
url = url_node.str_content
|
||||||
|
|
||||||
return unless url.match?(%r{^.+://[^/]+$})
|
return unless url&.match?(%r{^.+://[^/]+$})
|
||||||
|
|
||||||
add_offense(url_node, location: :expression,
|
add_offense(url_node, location: :expression,
|
||||||
message: format(MSG_NO_SLASH, url: url))
|
message: format(MSG_NO_SLASH, url: url))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user