> On March 23, 2015, 6:28 p.m., Madhan Neethiraj wrote:
> > ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java,
> >  line 277
> > <https://reviews.apache.org/r/32245/diff/1/?file=900095#file900095line277>
> >
> >     It would be safer to handle null value for userEntry and 
> > userEntry.getAttributes() as well; unless it is certain this didn't cause 
> > the NPE issue and that these will never be null.
> >     
> >     Attribute userNameAttr = (userEntry != null && 
> > userEntry.getAttributes() != null) ? 
> > userEntry.getAttributyes.get(userNameAttribute) : null;

These did not cause NPE.
Inside the loop userEntry can not be null.
userEntry.getAttributes() would not return null.

NPE was caused by userNameAttr being null.


- dilli


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32245/#review77437
-----------------------------------------------------------


On March 19, 2015, 5:39 p.m., dilli dorai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32245/
> -----------------------------------------------------------
> 
> (Updated March 19, 2015, 5:39 p.m.)
> 
> 
> Review request for ranger.
> 
> 
> Bugs: RANGER-320
>     https://issues.apache.org/jira/browse/RANGER-320
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-320: Usersync NPE when object does not have userNameAttribute
> 
> 
> Diffs
> -----
> 
>   
> ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
>  b6bb811 
> 
> Diff: https://reviews.apache.org/r/32245/diff/
> 
> 
> Testing
> -------
> 
> Reproduced NPE before the patch.
> Verified NPE is not triggered after the patch.
> 
> 
> Thanks,
> 
> dilli dorai
> 
>

Reply via email to