mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
Update misc.py
Before fix: Chat engagement failed with TypeError and KeyError After fix: Chat works smoothly with automatic title generation and proper history
This commit is contained in:
parent
d414662d23
commit
256034e285
1 changed files with 4 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ def get_message_list(messages, message_id):
|
|||
:return: List of ordered messages starting from the root to the given message
|
||||
"""
|
||||
|
||||
# Handle case where messages is None
|
||||
if not messages:
|
||||
return [] # Return empty list instead of None to prevent iteration errors
|
||||
|
||||
# Find the message by its id
|
||||
current_message = messages.get(message_id)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue