Skip to content

Commit e40b133

Browse files
committed
Apply pull request suggestions from github copilot
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
1 parent a8a5c83 commit e40b133

File tree

1 file changed

+3
-1
lines changed
  • experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl

1 file changed

+3
-1
lines changed

experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ public static <R> JavaContextFunction<Object, R> enriched(Function<WorkflowModel
362362
public static <T, R> JavaContextFunction<T, R> enrichedOutput(
363363
EnrichWithModelBiFunction<T, R> fn, Class<T> taskOutputClass) {
364364
return (taskOutput, workflowContext) -> {
365+
Objects.requireNonNull(taskOutputClass, "taskOutputClass must not be null");
365366
final WorkflowModel rootInput = workflowContext.instanceData().input();
366-
return fn.apply(taskOutput, rootInput);
367+
final T typedTaskOutput = taskOutputClass.cast(taskOutput);
368+
return fn.apply(typedTaskOutput, rootInput);
367369
};
368370
}
369371

0 commit comments

Comments
 (0)