Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Result is not necessarily defined here
Browse files Browse the repository at this point in the history
You can get an undefined result at this point, since `runStep` can be called with an empty result. I don't believe it is assumed that an action handler is called always after the previous step generated a result

Until this is fixed, what would be an alternative?
  • Loading branch information
alex-ubitec authored Jul 1, 2020
1 parent 848712b commit 6d05622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/botkit/src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ export class BotkitConversation<O extends object = {}> extends Dialog<O> {
const index = step.index;
const thread_name = step.thread;
const result = step.result;
const response = result.text || (typeof (result) === 'string' ? result : null);
const response = result == null ? null : (result.text || (typeof (result) === 'string' ? result : null));

// spawn a bot instance so devs can use API or other stuff as necessary
const bot = await this._controller.spawn(dc);
Expand Down

0 comments on commit 6d05622

Please sign in to comment.