directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Seelmann (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DIRSTUDIO-1133) Potential NPE issue
Date Sun, 25 Dec 2016 19:34:58 GMT

     [ https://issues.apache.org/jira/browse/DIRSTUDIO-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Seelmann resolved DIRSTUDIO-1133.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0-M13

> Potential NPE issue
> -------------------
>
>                 Key: DIRSTUDIO-1133
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-1133
>             Project: Directory Studio
>          Issue Type: Bug
>            Reporter: Jaechang Nam
>            Priority: Minor
>             Fix For: 2.0.0-M13
>
>
> It seems there is an incorrect condition in if statement "else if ( filterList != null
|| !filterList.isEmpty() )". (still existing in the current snapshot, 1bf525559583e7469149038fa58adeffb2b5a246).
If filterList is null, it would cause NPE.
> {code}
> 256     public LdapFilter getFilter( int offset )
> 257     {
> 258         if ( startToken != null && startToken.getOffset() == offset )
> 259         {
> 260             return parent;
> 261         }
> 262         else if ( filterList != null || !filterList.isEmpty() )
> 263         {
> 264             for ( Iterator<LdapFilter> it = filterList.iterator(); it.hasNext();
)
> 265             {
> 266                 LdapFilter filter = it.next();
> 267                 if ( filter != null && filter.getFilter( offset ) != null
)
> 268                 {
> 269                     return filter.getFilter( offset );
> 270                 }
> 271             }
> 272             return null;
> 273         }
> 274         else
> 275         {
> 276             return null;
> 277         }
> 278     }
> {code}
> The indented code was this?
> {code}
> 262         else if ( filterList != null && !filterList.isEmpty() )
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message