Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-217

SyncopeUser.hasTokenExpired() can easily cause nullpointer exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.2-incubating
    • Fix Version/s: 1.0.3-incubating, 1.1.0
    • Component/s: core
    • Labels:
      None

      Description

      public boolean hasTokenExpired() {
      return tokenExpireTime.before(new Date());
      }

      should be changed to:

      public boolean hasTokenExpired() {
      return tokenExpireTime == null
      ? false
      : tokenExpireTime.before(new Date());
      }

      A token set to null should never expire to be consistent with the behavior that a token will always be vaild valid (in checkToken method) if it is null.

        Attachments

        1. SyncopeUser.java.patch
          0.6 kB
          Jan Bernhardt
        2. SyncopeUser.java.patch
          0.7 kB
          Jan Bernhardt

          Activity

            People

            • Assignee:
              ilgrosso Francesco Chicchiriccò
              Reporter:
              jan4talend Jan Bernhardt
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: