From 5507bfb50d47df49cdca33c4081bb129fad50195 Mon Sep 17 00:00:00 2001 From: NxP4Code <56322272+NxP4Code@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:35:46 -0500 Subject: [PATCH] Update core.ts controller.spawn() throws UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'context' of undefined . Fix for Bug#1945 --- packages/botkit/src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/botkit/src/core.ts b/packages/botkit/src/core.ts index 86f8bfa71..14d271bba 100644 --- a/packages/botkit/src/core.ts +++ b/packages/botkit/src/core.ts @@ -1077,7 +1077,7 @@ export class Botkit { } let worker: BotWorker = null; - const adapter = custom_adapter || (config.context && config.context.adapter) ? config.context.adapter : this.adapter; + const adapter = custom_adapter || (config && config.context && config.context.adapter) ? config.context.adapter : this.adapter; if (adapter.botkit_worker) { const CustomBotWorker = adapter.botkit_worker;