From 96f6a1a8cbf5d7745e1a3b0d11b984713b9ee4f4 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 28 Jan 2011 21:21:02 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50680 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 | 13 +++++++++---- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/java/org/apache/jasper/compiler/TagFileProcessor.java b/java/org/apache/jasper/compiler/TagFileProcessor.java index 6197517e2..9da39788c 100644 --- a/java/org/apache/jasper/compiler/TagFileProcessor.java +++ b/java/org/apache/jasper/compiler/TagFileProcessor.java @@ -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); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 4982279b5..957e3473b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -150,6 +150,11 @@ Improve error message when EL identifiers are not valid Java identifiers and use i18n for the error message. (markt) + + 50680: Prevent an NPE when using tag files from an exploded + JAR file, e.g. from within an IDE. Patch provided by Larry Isaacs. + (markt) + -- 2.11.0