Fix NPE if something tries to access resources accessed during a stop.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 17 Aug 2009 21:40:41 +0000 (21:40 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 17 Aug 2009 21:40:41 +0000 (21:40 +0000)
This was seen when unpackWARs="false" and the JDBC clean up code tried to load the leak prevention class during a context stop.

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

java/org/apache/naming/resources/WARDirContext.java

index 5eaa36b..9a4293f 100644 (file)
@@ -797,7 +797,7 @@ public class WARDirContext extends BaseDirContext {
      * Entry tree lookup.
      */
     protected Entry treeLookup(Name name) {
-        if (name.isEmpty())
+        if (name.isEmpty() || entries == null)
             return entries;
         Entry currentEntry = entries;
         for (int i = 0; i < name.size(); i++) {