Handle nil resource args for some reason
- Ran this against `signal-cli` and despite it having a valid-looking resource block, it failed on `undefined method 'str_content' for nil:NilClass`.
This commit is contained in:
parent
5c7be57531
commit
3bfe7e5aa1
@ -19,7 +19,7 @@ module RuboCop
|
||||
return if resource_nodes.empty?
|
||||
|
||||
%w[lxml pyyaml].each do |resource_name|
|
||||
found = resource_nodes.find { |node| node.arguments.first.str_content == resource_name }
|
||||
found = resource_nodes.find { |node| node.arguments&.first&.str_content == resource_name }
|
||||
next unless found
|
||||
|
||||
uses_from_macos_nodes = find_every_method_call_by_name(body_node, :uses_from_macos)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user