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

TokenSessionStoreInterceptor fails with NPE when no token is provided.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6
    • 2.1.8
    • Core Interceptors
    • None
    • 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

            wesw@wantii.com Wes Wannemacher
            jpeltzer James Peltzer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: