# HG changeset patch # User cin # Date 2021-09-02 00:54:31 # Node ID 2807ab11174c7446830d91d5f1b652a18c6ecae5 # Parent 861883ccc8d83afb1cc63b01536e4201af7a6f2d minor fix diff --git a/djx/src/main/ts/tsx/DjxWidgetBase.ts b/djx/src/main/ts/tsx/DjxWidgetBase.ts --- a/djx/src/main/ts/tsx/DjxWidgetBase.ts +++ b/djx/src/main/ts/tsx/DjxWidgetBase.ts @@ -1,4 +1,4 @@ -import { djbase, djclass, prototype } from "../declare"; +import { djbase, djclass } from "../declare"; import _WidgetBase = require("dijit/_WidgetBase"); import _AttachMixin = require("dijit/_AttachMixin"); import { Rendition, isNode } from "./traits"; @@ -61,11 +61,12 @@ export abstract class DjxWidgetBase; private _connectEventHandlers() { - this._eventHandlers.forEach(({eventName, handlerMethod}) => { - const handler = this[handlerMethod as keyof this]; - if (typeof handler === "function") - this.on(eventName, handler.bind(this)); - }); + if (this._eventHandlers) + this._eventHandlers.forEach(({ eventName, handlerMethod }) => { + const handler = this[handlerMethod as keyof this]; + if (typeof handler === "function") + this.on(eventName, handler.bind(this)); + }); } _processTemplateNode(