Skip to content

Commit

Permalink
Fix for exception thrown when LexV2 responsebot matches Fallback intent
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrahan committed Jul 7, 2021
1 parent dc9f6bd commit 83a88da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lambda/fulfillment/lib/middleware/lexRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function handleRequest(req, res, botName, botAlias) {
console.log("Lex V2 parameters: " + JSON.stringify(params));
const lexv2response = await lexV2ClientRequester(params);
console.log("Lex V2 response: " + JSON.stringify(lexv2response));
response.message = lexv2response.messages[0].content;
response.message = _.get(lexv2response, 'messages[0].content', '');
// lex v2 FallbackIntent match means it failed to fill desired slot(s).
if (lexv2response.sessionState.intent.name === "FallbackIntent" ||
lexv2response.sessionState.intent.state === "Failed") {
Expand Down

0 comments on commit 83a88da

Please sign in to comment.