防止字体前置校验访问空值

对外部状态中的空字体引用返回正常校验结果而不是抛出异常。
This commit is contained in:
2026-09-11 19:00:49 +08:00
parent c3de2ce958
commit a9358bf3ce
@@ -194,7 +194,12 @@ export function validateAssetSeparationResult(
}
if ('Text' in component) {
const font = component.Text.font;
if (typeof font !== 'string' && !(font.Bound in state.font_assets)) {
if (
font !== null &&
font !== undefined &&
typeof font !== 'string' &&
!(font.Bound in state.font_assets)
) {
issues.push({
code: 'missing-font',
message: '文本组件引用的字体不存在',