My guess is that request.getAttribute(RewriteLifecycleContext.LIFECYCLE_CONTEXT_KEY) returns null, but actually I don’t see a reason why this is happening. This attribute is set by the filter and I see no reason why it could be absent.
Any chance that you could try to debug this in your IDE. It would be interesting to see what is null here. This should be possible with an exception breakpoint.
Or could you perhaps provide a minimal sample app that reproduces this?
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.