Skip to content

Commit 8a386b3

Browse files
committed
Add boolen condition to check if ErrorAttribues are present
1 parent cf1a9b4 commit 8a386b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/function/FunctionEndpointInitializer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ public class FunctionEndpointInitializer implements ApplicationContextInitialize
8787
private static boolean webflux = ClassUtils
8888
.isPresent("org.springframework.web.reactive.function.server.RouterFunction", null);
8989

90+
private static boolean errorAttributes = ClassUtils
91+
.isPresent("org.springframework.boot.webflux.error.ErrorAttributes", null);
92+
9093
@Override
9194
public void initialize(GenericApplicationContext context) {
92-
if (webflux && ContextFunctionCatalogInitializer.enabled
95+
if (errorAttributes && webflux && ContextFunctionCatalogInitializer.enabled
9396
&& context.getEnvironment().getProperty(FunctionalSpringApplication.SPRING_WEB_APPLICATION_TYPE,
9497
WebApplicationType.class, WebApplicationType.REACTIVE) == WebApplicationType.REACTIVE
9598
&& context.getEnvironment().getProperty("spring.functional.enabled", Boolean.class, false)) {

0 commit comments

Comments
 (0)