quite hard to parse such complex unless. I think it is better to have simplier code
```
if result && !result.empty?
```