防止字体前置校验访问空值
对外部状态中的空字体引用返回正常校验结果而不是抛出异常。
This commit is contained in:
@@ -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: '文本组件引用的字体不存在',
|
||||
|
||||
Reference in New Issue
Block a user