redbird
redbird copied to clipboard
Prevent exceptions related to onRequest logic due to missing opts adoption in custom resolvers.
The current implementation of the onRequest
logic requires the opts
attribute to exist when getting a target from a registered route or a custom resolver's returned object. The case for the object returned by custom resolvers is that opts
isn't set and the code fails with an exception due to the attempt of calling onRequest
of undefined
.
This PR makes sure opts
is set and that its existence and onRequest
being a function are first being checked on before processing.