You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/01/18 14:04:36 UTC
[jira] Assigned: (SLING-158) NPE in SlingIOProvider if resource
does not exist
[ https://issues.apache.org/jira/browse/SLING-158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger reassigned SLING-158:
---------------------------------------
Assignee: Felix Meschberger
> NPE in SlingIOProvider if resource does not exist
> -------------------------------------------------
>
> Key: SLING-158
> URL: https://issues.apache.org/jira/browse/SLING-158
> Project: Sling
> Issue Type: Bug
> Components: JSP
> Reporter: Tobias Bocanegra
> Assignee: Felix Meschberger
>
> for example when resolving a tag library:
> Caused by: java.lang.NullPointerException
> at org.apache.sling.scripting.jsp.SlingIOProvider.getInputStream(SlingIOProvider.java:96)
> at org.apache.sling.scripting.jsp.jasper.compiler.TagLibraryInfoImpl.getResourceAsStream(TagLibraryInfoImpl.java:120)
> at org.apache.sling.scripting.jsp.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:155)
> at org.apache.sling.scripting.jsp.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
> at org.apache.sling.scripting.jsp.jasper.compiler.Parser.parseDirective(Parser.java:476)
> at org.apache.sling.scripting.jsp.jasper.compiler.Parser.parseElements(Parser.java:1426)
> at org.apache.sling.scripting.jsp.jasper.compiler.Parser.parse(Parser.java:133)
> Suggested patch:
> Index: src/main/java/org/apache/sling/scripting/jsp/SlingIOProvider.java
> ===================================================================
> --- src/main/java/org/apache/sling/scripting/jsp/SlingIOProvider.java (revision 612138)
> +++ src/main/java/org/apache/sling/scripting/jsp/SlingIOProvider.java (working copy)
> @@ -93,6 +93,9 @@
> throws FileNotFoundException, IOException {
> try {
> Resource resource = getResourceInternal(fileName);
> + if (resource == null) {
> + throw new FileNotFoundException("Cannot find " + fileName);
> + }
> InputStream stream = resource.adaptTo(InputStream.class);
> if (stream == null) {
> throw new FileNotFoundException("Cannot find " + fileName);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.