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

Angela Schreiber commented on SLING-11367:
------------------------------------------

[~cziegeler], i don't think my fix would make the code more complicated. 
instead it would IMHO become more readable and the next developer looking at 
this would not be wondering why nobody cared about a potential NPE. i will 
create a PR and let you review it.

> Potential NPE as ResolveContext.getProviderState() is nullable 
> ---------------------------------------------------------------
>
>                 Key: SLING-11367
>                 URL: https://issues.apache.org/jira/browse/SLING-11367
>             Project: Sling
>          Issue Type: Sub-task
>          Components: JCR
>    Affects Versions: JCR Resource 3.2.0
>            Reporter: Angela Schreiber
>            Priority: Minor
>
> since {{ResolveContext.getProviderState()}} is defined to return a nullable 
> provider state code analysis spots this a potential source for NPE. according 
> to [~cziegeler] this should never return null as long as the provider is 
> active.
> i would suggest to move access to session, resourcefactory and helperdata to 
> a utility with comments on why the NPE should not occur.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to