redbird icon indicating copy to clipboard operation
redbird copied to clipboard

Prevent exceptions related to onRequest logic due to missing opts adoption in custom resolvers.

Open cactysman opened this issue 4 years ago • 0 comments

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.

cactysman avatar Feb 17 '21 05:02 cactysman