Skip to content

Commit

Permalink
Merge pull request #1 from pavel-one/fix_check_nil_in_final
Browse files Browse the repository at this point in the history
check nil for message in final.go
  • Loading branch information
pavel-one authored Apr 11, 2023
2 parents fbcbede + 8ecb2f9 commit 0edc7aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions responses/final.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ func (r *Final) GetAnswer() string {

message := item.Messages[len(item.Messages)-1]

if message.AdaptiveCards == nil {
return ""
}
if message.AdaptiveCards[0].Body == nil {
return ""
}

return message.AdaptiveCards[0].Body[0].Text
}

Expand Down

0 comments on commit 0edc7aa

Please sign in to comment.