Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50680
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 28 Jan 2011 21:21:02 +0000 (21:21 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 28 Jan 2011 21:21:02 +0000 (21:21 +0000)
Prevent an NPE when using tag files from an exploded JAR file, e.g. from within an IDE.
Patch provided by Larry Isaacs.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1064890 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/TagFileProcessor.java
webapps/docs/changelog.xml

index 6197517..9da3978 100644 (file)
@@ -626,10 +626,15 @@ class TagFileProcessor {
                         compiler.getCompilationContext().getTldLocation(
                             tagFileInfo.getTagInfo().getTagLibrary().getURI());
                     JarResource jarResource = location.getJarResource();
-                    // Add TLD
-                    pageInfo.addDependant(jarResource.getEntry(location.getName()).toString());
-                    // Add Tag
-                    pageInfo.addDependant(jarResource.getEntry(tagFilePath.substring(1)).toString());
+                    if (jarResource != null) {
+                        // Add TLD
+                        pageInfo.addDependant(jarResource.getEntry(location.getName()).toString());
+                        // Add Tag
+                        pageInfo.addDependant(jarResource.getEntry(tagFilePath.substring(1)).toString());
+                    }
+                    else {
+                        pageInfo.addDependant(tagFilePath);
+                    }
                 } else {
                     pageInfo.addDependant(tagFilePath);
                 }
index 4982279..957e347 100644 (file)
         Improve error message when EL identifiers are not valid Java identifiers
         and use i18n for the error message. (markt)
       </update>
+      <fix>
+        <bug>50680</bug>: Prevent an NPE when using tag files from an exploded
+        JAR file, e.g. from within an IDE. Patch provided by Larry Isaacs.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">