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(