Skip to content

fix: check conversation existence before accessing .title in generate_chat_title#1335

Open
Hariom9893 wants to merge 1 commit into
khoj-ai:masterfrom
Hariom9893:fix/generate-chat-title-null-check
Open

fix: check conversation existence before accessing .title in generate_chat_title#1335
Hariom9893 wants to merge 1 commit into
khoj-ai:masterfrom
Hariom9893:fix/generate-chat-title-null-check

Conversation

@Hariom9893

Copy link
Copy Markdown

What

Fixes an AttributeError crash in generate_chat_title.

Why

If aget_conversation_by_user returns None, the current code accesses
conversation.title before the None check, raising an AttributeError
before the 404 guard is ever reached.

Fix

Swapped the order of the two checks so None is handled first.

@Hariom9893

Copy link
Copy Markdown
Author

Any update regarding the pull request , if it needs any changes please inform me so i can fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant