File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
core/spring-boot/src/main/java/org/springframework/boot Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public interface ApplicationContextFactory {
76
76
* @param webApplicationType the web application type
77
77
* @return the newly created application context
78
78
*/
79
- ConfigurableApplicationContext create (@ Nullable WebApplicationType webApplicationType );
79
+ @ Nullable ConfigurableApplicationContext create (@ Nullable WebApplicationType webApplicationType );
80
80
81
81
/**
82
82
* Creates an {@code ApplicationContextFactory} that will create contexts by
Original file line number Diff line number Diff line change @@ -569,7 +569,10 @@ protected void bindToSpringApplication(ConfigurableEnvironment environment) {
569
569
* @see #setApplicationContextFactory(ApplicationContextFactory)
570
570
*/
571
571
protected ConfigurableApplicationContext createApplicationContext () {
572
- return this .applicationContextFactory .create (this .properties .getWebApplicationType ());
572
+ ConfigurableApplicationContext context = this .applicationContextFactory
573
+ .create (this .properties .getWebApplicationType ());
574
+ Assert .state (context != null , "ApplicationContextFactory created null context" );
575
+ return context ;
573
576
}
574
577
575
578
/**
You can’t perform that action at this time.
0 commit comments