阻止本地素材登记结果错位回填
资源导入返回数量与请求路径不一致时立即中止位置映射。
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user