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

Felix Meschberger commented on SLING-390:
-----------------------------------------

Oops, this is probably completely wrong. Thanks for pointing this out.

Will fix it along with the SLING-387 stuff.

> NPE in SlingServletResolver (script == null accessed)
> -----------------------------------------------------
>
>                 Key: SLING-390
>                 URL: https://issues.apache.org/jira/browse/SLING-390
>             Project: Sling
>          Issue Type: Bug
>          Components: ServletResolver
>            Reporter: Alexander Klimetschek
>            Assignee: Felix Meschberger
>            Priority: Critical
>
> This warning popped up after I imported the trunk into Eclipse; it's in 
> SlingServletResolver.findScript() at line 225 ff:
>                 SlingScript script = resource.adaptTo(SlingScript.class);
>                 if (script == null) {
>                     log.debug("findScript: Using script {} for {}",
>                         script.getScriptResource().getPath(), name);
>                     return script;
>                 }
> Inside the if block, script will be null, thus script.getScriptResource() 
> will fail with an NPE and also returning script seems wrong here.
> I assume the condition should be if (script != null) instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to