From 2ed30d32aa2b3543db4f9ea22e60270650883d52 Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Thu, 13 Feb 2025 09:36:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbutton=20client=20events?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AEtarget=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=E8=84=9A=E6=9C=AC=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/inject/code-hint.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripts/inject/code-hint.ts b/src/scripts/inject/code-hint.ts index af34c0d..47e28b8 100644 --- a/src/scripts/inject/code-hint.ts +++ b/src/scripts/inject/code-hint.ts @@ -27,10 +27,16 @@ function getButton(node: any, fillFn: boolean): FunctionInfo[] { const ret: FunctionInfo[] = []; for (let i = 0; i < arr.length; i++) { const item = arr[i]; + if (!item.target) { + continue; + } const compType = cc.js._getClassById(item._componentId); if (!compType) { continue; } + if (!item.target.getComponent) { + continue; + } const comp = item.target.getComponent(compType); if (!comp || !cc.isValid(comp)) { continue;