From efc69e37c445a11649b63d814abd7f592dedb5d4 Mon Sep 17 00:00:00 2001 From: skie1997 Date: Thu, 26 Oct 2023 14:21:37 +0800 Subject: [PATCH] fix: event on error after release --- packages/vchart/src/core/vchart.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/vchart/src/core/vchart.ts b/packages/vchart/src/core/vchart.ts index 3c71ce8b43..7ab9ade6ce 100644 --- a/packages/vchart/src/core/vchart.ts +++ b/packages/vchart/src/core/vchart.ts @@ -989,6 +989,9 @@ export class VChart implements IVChart { on(eType: EventType, handler: EventCallback): void; on(eType: EventType, query: EventQuery, handler: EventCallback): void; on(eType: EventType, query: EventQuery | EventCallback, handler?: EventCallback): void { + if (!this._userEvents || this._userEvents.length === 0) { + return; + } this._userEvents.push({ eType, query: typeof query === 'function' ? null : query,