Skip to content

Commit 674b454

Browse files
committed
Added null check on spring boot profiles
1 parent f80dc5d commit 674b454

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aws-serverless-java-container-spring/src/main/java/com/amazonaws/serverless/proxy/spring/SpringBootLambdaContainerHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ protected void handleRequest(AwsProxyHttpServletRequest containerRequest, AwsHtt
113113

114114
// wire up the application context on the first invocation
115115
if (!initialized) {
116-
System.setProperty("spring.profiles.active", String.join(",", springProfiles));
116+
if (springProfiles != null && springProfiles.length > 0) {
117+
System.setProperty("spring.profiles.active", String.join(",", springProfiles));
118+
}
117119
SpringServletContainerInitializer springServletContainerInitializer = new SpringServletContainerInitializer();
118120
LinkedHashSet<Class<?>> webAppInitializers = new LinkedHashSet<>();
119121
webAppInitializers.add(springBootInitializer);

0 commit comments

Comments
 (0)