steinarb commented on code in PR #2861:
URL: https://github.com/apache/shiro/pull/2861#discussion_r3794198302


##########
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/AuthenticationFilterDelegate.java:
##########
@@ -101,7 +104,10 @@ public boolean preHandle(ServletRequest request, 
ServletResponse response) throw
     public boolean isAccessAllowed(ServletRequest request, ServletResponse 
response, Object mappedValue) {
         Subject subject = methods.getSubject(request, response);
         boolean isAuthenticated = subject.isAuthenticated() && 
subject.getPrincipal() != null;
-        return isAuthenticated || (useRemembered && subject.isRemembered());
+        return isAuthenticated || (useRemembered && subject.isRemembered())

Review Comment:
   (or: if the NPE wasn't here, a test that replicates the NPE stack trace. I 
usually make such tests as simple as possible with as much mocking as possible, 
targeting own code)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to