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;