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
ArrayList<WebApplicationInitializer> initializers = new ArrayList<WebApplicationInitializer>(); ArrayList<WebApplicationInitializer> initializers = new ArrayList<WebApplicationInitializer>();
for (Class<?> waiClass : webAppInitializerClasses) { if (webAppInitializerClasses != null) {
if (!Modifier.isAbstract(waiClass.getModifiers())) { for (Class<?> waiClass : webAppInitializerClasses) {
// the class can be instantiated -> add it if (!Modifier.isAbstract(waiClass.getModifiers())) {
initializers.add(instantiateClass(waiClass, WebApplicationInitializer.class)); // the class can be instantiated -> add it
initializers.add(instantiateClass(waiClass, WebApplicationInitializer.class));
}
} }
} }

Loading…
Cancel
Save