diff --git a/apps/web/src/pages/generate/hooks/step2-materials/useSmartMatch.ts b/apps/web/src/pages/generate/hooks/step2-materials/useSmartMatch.ts index 736181ed1..e297b4626 100755 --- a/apps/web/src/pages/generate/hooks/step2-materials/useSmartMatch.ts +++ b/apps/web/src/pages/generate/hooks/step2-materials/useSmartMatch.ts @@ -69,7 +69,8 @@ export function useSmartMatch({ // 调用后端智能匹配 API(后端也会排除已用尽素材,这里前端兜底过滤) const result = await smartMatchAssets(libraryId, limit) - const matched = (result.items ?? []).filter(isAssetUsable) + // 兜底过滤:id 为空或不可用的素材不参与匹配(smartMatchAssets 已做归一化,这里双保险) + const matched = (result.items ?? []).filter((a) => !!a?.id && isAssetUsable(a)) const matchedIds = matched.map((a: AssetItem) => a.id) if (matchedIds.length > 0) {