From aff7ca12b8b84cdf900cbe1598ae18a551856e11 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Thu, 4 Sep 2025 19:25:08 +0800 Subject: [PATCH] fix(code_node): type checking bypass Signed-off-by: -LAN- --- api/core/workflow/nodes/code/code_node.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/code/code_node.py b/api/core/workflow/nodes/code/code_node.py index 61820cc700..07cb726451 100644 --- a/api/core/workflow/nodes/code/code_node.py +++ b/api/core/workflow/nodes/code/code_node.py @@ -265,8 +265,11 @@ class CodeNode(Node): elif output_config.type == SegmentType.STRING: # check if string available + value = result.get("output_name") + if value is not None and not isinstance(value, str): + raise OutputValidationError(f"Output value `{value}` is not string") transformed_result[output_name] = self._check_string( - value=result[output_name], + value=value, variable=f"{prefix}{dot}{output_name}", ) elif output_config.type == SegmentType.BOOLEAN: