I am trying to access to a session attribute from a Filter in my webapp running on Tomcat:
boolean socialLogin = (Boolean) session.getAttribute("socialLogin");
I'm getting a NullPointerException
, how can I handle the situation of if the attribute exists or not without having to catch a NPE?
The sessión is not null, I have checked it before.