Perhaps. But the real problem in your code is here:

```ruby
        def on_block(node)
          method, _, body = *node
          return if body.nil?

          _, method_name = *method
          return unless method?(method_name)
          return unless ends_with_condition?(body)

          add_offense(method, :selector, MSG)
        end
```

You should check whether `method` is a `send` node there.