Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3150

TokenSessionStoreInterceptor fails with NPE when no token is provided.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.1.8
    • Component/s: Core Interceptors
    • Labels:
      None
    • Environment:

      N/A

      Description

      TokenSessionStoreInterceptor fails when no token is provided.
      java.lang.NullPointerException at java.util.TreeMap.getEntry(Unknown Source) at java.util.TreeMap.get(Unknown Source) at org.apache.struts2.util.TokenHelper.getToken(TokenHelper.java:101) at org.apache.struts2.interceptor.TokenSessionStoreInterceptor.handleInvalidToken(TokenSessionStoreInterceptor.java:117) at org.apache.struts2.interceptor.TokenInterceptor.doIntercept(TokenInterceptor.java:141) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
      ...

      It looks like it could be solved if the TokenHelper class checks to make sure it isn't trying to look up a null token name and just returns null immediately.

        Attachments

          Activity

            People

            • Assignee:
              wesw@wantii.com Wes Wannemacher
              Reporter:
              jpeltzer James Peltzer

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment