FIX: guard against situations where there is no reply, pass thread id (#1279)

This commit is contained in:
Sam 2025-04-24 21:31:14 +11:00 committed by GitHub
parent 2a5c60db10
commit 2060426709
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,7 @@ module DiscourseAi
ChatSDK::Message.create(
raw: message,
channel_id: channel.id,
thread_id: thread_id,
guardian: guardian,
force_thread: force_thread,
in_reply_to_id: in_reply_to_id,
@ -78,7 +79,7 @@ module DiscourseAi
def done
@queue << :done
@worker_thread.join
ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian)
ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian) if @reply
@reply
end