mirror of
https://github.com/langgenius/dify.git
synced 2026-03-13 02:57:41 +08:00
fix: resolve type error in node_factory by using type guard for node_type_str
This commit is contained in:
@ -50,8 +50,8 @@ class DifyNodeFactory(NodeFactory):
|
||||
raise ValueError(f"Node {node_id} missing data information")
|
||||
|
||||
node_type_str = node_data.get("type")
|
||||
if not node_type_str:
|
||||
raise ValueError(f"Node {node_id} missing type information")
|
||||
if not is_str(node_type_str):
|
||||
raise ValueError(f"Node {node_id} missing or invalid type information")
|
||||
|
||||
try:
|
||||
node_type = NodeType(node_type_str)
|
||||
|
||||
Reference in New Issue
Block a user