objectcomputing / check-ins

Other
7 stars 7 forks source link

fix: Request is marked nullable, so should be checked #2516

Closed timyates closed 4 days ago

timyates commented 1 week ago

In the PermissionSecurityRule, the request object is annotated as Nullable, but we weren't testing for null.

This PR checks for null first of all.

I refactored the method into a optional flow which I hope is easier to read.

And then fixed the tests (we no longer call hasAnnotation as findAnnotation returns an optional, so provides enough info to continue)