fix(editor): root为空时异常处理

This commit is contained in:
roymondchen 2022-05-07 16:39:28 +08:00 committed by jia000
parent 327fc47aa1
commit 7d62c09c6b

View File

@ -91,7 +91,7 @@ class Editor extends BaseService {
log('store set ', name, ' ', value); log('store set ', name, ' ', value);
if (name === 'root') { if (name === 'root') {
this.state.pageLength = (value as unknown as MApp).items.length; this.state.pageLength = (value as unknown as MApp)?.items?.length || 0;
this.emit('root-change', value); this.emit('root-change', value);
} }
} }