Skip to content

Commit 810ef47

Browse files
AugustEndJackLian
authored andcommitted
fix: add protection logic for node-helper.ts when using callbacks
1 parent 93e9b6e commit 810ef47

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/utils/src/node-helper.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const getClosestNode = (
2323
* @returns {boolean} 是否可点击,true表示可点击
2424
*/
2525
export const canClickNode = (node: IPublicModelNode, e: unknown): boolean => {
26-
const onClickHook = node.componentMeta?.advanced.callbacks?.onClickHook;
26+
const onClickHook = node.componentMeta?.advanced?.callbacks?.onClickHook;
2727
const canClick = typeof onClickHook === 'function' ? onClickHook(e as MouseEvent, node) : true;
2828
return canClick;
2929
};

0 commit comments

Comments
 (0)