Fix possible NPE
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 22 Jul 2010 10:43:43 +0000 (10:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 22 Jul 2010 10:43:43 +0000 (10:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@966570 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/StandardEngine.java

index e2a960a..a463f44 100644 (file)
@@ -317,7 +317,9 @@ public class StandardEngine extends ContainerBase implements Engine {
                 if (defaultAccessLog == null) {
                     // Try the ROOT context of default host
                     Context context = (Context) host.findChild("");
-                    defaultAccessLog = context.getAccessLog();
+                    if (context != null) {
+                        defaultAccessLog = context.getAccessLog();
+                    }
 
                     if (defaultAccessLog == null) {
                         defaultAccessLog = new NoopAccessLog();