Skip to content

Commit

Permalink
fix: add error handling condition
Browse files Browse the repository at this point in the history
  • Loading branch information
chuang8511 committed Nov 5, 2024
1 parent 8cbf371 commit 46973ac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (e *execution) readChatHistory(ctx context.Context, job *base.Job) error {
ConversationId: inputStruct.ConversationID,
})

if len(conversationRes.Conversations) == 0 || err != nil {
if err != nil || conversationRes == nil || len(conversationRes.Conversations) == 0 {
err = job.Output.WriteData(ctx, output)

if err != nil {
Expand Down

0 comments on commit 46973ac

Please sign in to comment.