From 4756badc1d614abe4b6bb4ecc89b71f4fcd092fd Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 29 Jun 2011 17:33:07 +0000 Subject: [PATCH] Prevent NPE in SpringServletContainerInitializer Issue: SPR-8496 --- .../web/SpringServletContainerInitializer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java b/org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java index f90fca5bc4..0b70116458 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java +++ b/org.springframework.web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java @@ -139,10 +139,12 @@ public class SpringServletContainerInitializer implements ServletContainerInitia ArrayList initializers = new ArrayList(); - 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)); + } } }