Avoid a possible NPE that in turn was masking the root cause from JspC
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 17 Dec 2010 13:52:22 +0000 (13:52 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 17 Dec 2010 13:52:22 +0000 (13:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1050384 13f79535-47bb-0310-9956-ffa450edef68

java/javax/servlet/jsp/tagext/TagLibraryInfo.java
webapps/docs/changelog.xml

index af9266a..ac9720d 100644 (file)
@@ -137,12 +137,12 @@ public abstract class TagLibraryInfo {
     public TagInfo getTag(String shortname) {
         TagInfo tags[] = getTags();
 
-        if (tags == null || tags.length == 0) {
+        if (tags == null || tags.length == 0 || shortname == null) {
             return null;
         }
 
         for (int i = 0; i < tags.length; i++) {
-            if (tags[i].getTagName().equals(shortname)) {
+            if (shortname.equals(tags[i].getTagName())) {
                 return tags[i];
             }
         }
index bb54e2d..b19926a 100644 (file)
         removed when the service stops which prevents the service from starting.
         (markt)
       </fix>
+      <fix>
+        <bug>14416</bug>: Make <code>TagLibraryInfo.getTag()</code> more robust
+        at handling <code>null</code>s. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>