I noticed this bug in the new router when I added a second domain to my router. It was pretty easy to track down the source of the issue so I figured I'd just submit a PR.
Basically the issue arises because :error is truthy, so if this inner Enum.find_value returns error on the first iteration (i.e. when checking for a match in the first domain), then the whole loop will return :error, even though there are more domains to check. In this scenario the intended behavior should be to return nil.
Contributor checklist
I noticed this bug in the new router when I added a second domain to my router. It was pretty easy to track down the source of the issue so I figured I'd just submit a PR.
Basically the issue arises because
:error
is truthy, so if this innerEnum.find_value
returns error on the first iteration (i.e. when checking for a match in the first domain), then the whole loop will return:error
, even though there are more domains to check. In this scenario the intended behavior should be to returnnil
.