lib/rubocop/cop/minitest/skip_ensure.rb in rubocop-minitest-0.35.1 vs lib/rubocop/cop/minitest/skip_ensure.rb in rubocop-minitest-0.36.0
- old
+ new
@@ -73,10 +73,12 @@
end
private
def find_skip(node)
- node.node_parts.first.descendants.detect { |n| n.send_type? && n.receiver.nil? && n.method?(:skip) }
+ return unless (body = node.node_parts.first)
+
+ body.descendants.detect { |n| n.send_type? && n.receiver.nil? && n.method?(:skip) }
end
def use_skip_in_rescue?(skip_method)
skip_method.ancestors.detect(&:rescue_type?)
end