CASC-233 ErrorRedirectFilter Can throw Null Pointer Exception

Problem: the ErrorRedirectFilter assumes there is a root cause and will null pointer if there is not.
Solution: Only use the root cause if there is one, otherwise use the original exception.

QA Notes: Added unit test to confirm non-root cause error.
I went with throwable as anything else would leave you in a state where you
could only redirect on some things.
On Nov 21, 2014 7:46 AM, "LELEU Jérôme" <notifications@github.com> wrote:

> In
> cas-client-core/src/main/java/org/jasig/cas/client/util/ErrorRedirectFilter.java:
>
> > @@ -58,8 +58,8 @@ public void doFilter(final ServletRequest request, final ServletResponse respons
> >          final HttpServletResponse httpResponse = (HttpServletResponse) response;
> >          try {
> >              filterChain.doFilter(request, response);
> > -        } catch (final ServletException e) {
> > -            final Throwable t = e.getCause();
> > +        } catch (final Throwable e) {
>
> I always find excessive a catch (Throwable. A catch on Exception was not
> enough?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Jasig/java-cas-client/pull/87/files#r20712545>.
>