diff --git a/src/core/classes/delegate-sorted.ts b/src/core/classes/delegate-sorted.ts index a71aa1677..acc8479c5 100644 --- a/src/core/classes/delegate-sorted.ts +++ b/src/core/classes/delegate-sorted.ts @@ -76,7 +76,7 @@ export class CoreSortedDelegate< * @inheritdoc */ hasHandlers(enabled = false): boolean { - return enabled ? !!this.sortedHandlers.length : !!this.handlers.length; + return enabled ? !!this.sortedHandlers.length : !!Object.keys(this.handlers).length; } /** diff --git a/src/core/classes/delegate.ts b/src/core/classes/delegate.ts index b491379c8..74bb8bce0 100644 --- a/src/core/classes/delegate.ts +++ b/src/core/classes/delegate.ts @@ -214,7 +214,7 @@ export class CoreDelegate { * @returns True if there's any registered handler, false otherwise. */ hasHandlers(enabled = false): boolean { - return enabled ? !!this.enabledHandlers.length : !!this.handlers.length; + return enabled ? !!Object.keys(this.enabledHandlers).length : !!Object.keys(this.handlers).length; } /**