diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts index 39726526d..850aa498b 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts +++ b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts @@ -1086,6 +1086,11 @@ export function useUiEditorSession( 'import_local_project_image_assets', { projectPath, relativePaths }, ); + if (imported.assets.length !== relativePaths.length) { + throw new Error( + `本地资源登记结果数量不匹配:请求 ${relativePaths.length} 个,返回 ${imported.assets.length} 个`, + ); + } for (const [assetIndex, asset] of imported.assets.entries()) { const normalizedAsset = { id: asset.id,