lib/fasterer/scanners/method_call_scanner.rb in fasterer-0.7.0 vs lib/fasterer/scanners/method_call_scanner.rb in fasterer-0.7.1
- old
+ new
@@ -128,9 +128,10 @@
body_method_call = MethodCall.new(method_call.block_body)
return unless body_method_call.arguments.count.zero?
return if body_method_call.has_block?
+ return if body_method_call.receiver.nil?
return unless body_method_call.receiver.name == method_call.block_argument_names.first
add_offense(:block_vs_symbol_to_proc)
end