diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs index 39618548b..d8998f1c3 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs @@ -30,6 +30,13 @@ pub fn apply_batch_patch( &batch, processed_dimensions, )?; + for decision in decisions { + if let BindingDecision::Ok { to_node, .. } = decision { + if !cut_paths.contains_key(to_node) { + return Err(format!("缺少节点 {} 的 cut 图片", to_node.as_str())); + } + } + } let rework_counts = batch_nodes .iter() .map(|node| (node.id.clone(), node.rework_count)) @@ -40,7 +47,7 @@ pub fn apply_batch_patch( BindingDecision::Ok { to_node, .. } => { let path = cut_paths .get(to_node) - .ok_or_else(|| format!("缺少节点 {} 的 cut 图片", to_node.as_str()))?; + .expect("cut path presence validated before patch"); state.bound.push(BoundNode { node_id: to_node.clone(), cut_image_path: path.clone(),