Browse Source

Prevent NPE in SpringServletContainerInitializer

Issue: SPR-8496
pull/7/head
Chris Beams 14 years ago
parent
commit
4756badc1d
  1. 10
      org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java

10
org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java

@ -139,10 +139,12 @@ public class SpringServletContainerInitializer implements ServletContainerInitia @@ -139,10 +139,12 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
ArrayList<WebApplicationInitializer> initializers = new ArrayList<WebApplicationInitializer>();
for (Class<?> waiClass : webAppInitializerClasses) {
if (!Modifier.isAbstract(waiClass.getModifiers())) {
// the class can be instantiated -> add it
initializers.add(instantiateClass(waiClass, WebApplicationInitializer.class));
if (webAppInitializerClasses != null) {
for (Class<?> waiClass : webAppInitializerClasses) {
if (!Modifier.isAbstract(waiClass.getModifiers())) {
// the class can be instantiated -> add it
initializers.add(instantiateClass(waiClass, WebApplicationInitializer.class));
}
}
}

Loading…
Cancel
Save