You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by "Francesco Chicchiriccò (JIRA)" <ji...@apache.org> on 2012/10/09 15:11:03 UTC

[jira] [Commented] (SYNCOPE-217) hasTokenExpired check for syncope user can easily cause nullpointer exception

    [ https://issues.apache.org/jira/browse/SYNCOPE-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472352#comment-13472352 ] 

Francesco Chicchiriccò commented on SYNCOPE-217:
------------------------------------------------

Please provide a patch and I will be happy to apply it.
                
> hasTokenExpired check for syncope user can easily cause nullpointer exception
> -----------------------------------------------------------------------------
>
>                 Key: SYNCOPE-217
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-217
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.2-incubating
>            Reporter: Jan Bernhardt
>            Priority: Minor
>             Fix For: 1.0.3-incubating, 1.1.0-incubating
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira