Avoid NPEs
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Feb 2010 21:26:28 +0000 (21:26 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Feb 2010 21:26:28 +0000 (21:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@907497 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/deploy/WebXml.java

index f3b9304..8b3b528 100644 (file)
@@ -1934,7 +1934,9 @@ public class WebXml {
         }
         
         if (dest.getLoadOnStartup() == null) {
-            dest.setLoadOnStartup(src.getLoadOnStartup().toString());
+            if (src.getLoadOnStartup() != null) {
+                dest.setLoadOnStartup(src.getLoadOnStartup().toString());
+            }
         } else if (src.getLoadOnStartup() != null) {
             if (failOnConflict &&
                     !src.getLoadOnStartup().equals(dest.getLoadOnStartup())) {
@@ -1943,7 +1945,9 @@ public class WebXml {
         }
         
         if (dest.getEnabled() == null) {
-            dest.setEnabled(src.getEnabled().toString());
+            if (src.getEnabled() != null) {
+                dest.setEnabled(src.getEnabled().toString());
+            }
         } else if (src.getEnabled() != null) {
             if (failOnConflict &&
                     !src.getEnabled().equals(dest.getEnabled())) {
@@ -1971,7 +1975,9 @@ public class WebXml {
         }
         
         if (dest.getAsyncSupported() == null) {
-            dest.setAsyncSupported(src.getAsyncSupported().toString());
+            if (src.getAsyncSupported() != null) {
+                dest.setAsyncSupported(src.getAsyncSupported().toString());
+            }
         } else if (src.getAsyncSupported() != null) {
             if (failOnConflict &&
                     !src.getAsyncSupported().equals(dest.getAsyncSupported())) {