I've gotten over the fear of implicit `nil`. How about:

```ruby
if provider && provider.api_key == key
  provider
end
```