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