fix: 修复导入的组件拖入画布报错

This commit is contained in:
mario.gk 2020-07-17 14:06:31 +08:00
parent cca33096d1
commit caf9915382
2 changed files with 2 additions and 2 deletions

View File

@ -826,7 +826,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
event: e, event: e,
}; };
if (e.dragObject.type === 'node' && e.dragObject.nodes[0].getPrototype().isModal()) { if (e.dragObject.type === 'node' && e.dragObject.nodes[0]?.getPrototype()?.isModal()) {
return this.designer.createLocation({ return this.designer.createLocation({
target: this.document.rootNode, target: this.document.rootNode,
detail: { detail: {

View File

@ -71,7 +71,7 @@ class TreeNodeChildren extends Component<{
/> />
); );
treeNode.children?.forEach((child, index) => { treeNode.children?.forEach((child, index) => {
const childIsModal = child.node.getPrototype().isModal(); const childIsModal = child.node.getPrototype()?.isModal() || false;
if (isModal != childIsModal) { if (isModal != childIsModal) {
return; return;
} }