diff --git a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py index aa9b0a4c2..fda33d17b 100644 --- a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py +++ b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py @@ -151,7 +151,12 @@ def upgrade() -> None: continue history = chat_data.get("history", {}) + if not isinstance(history, dict): + continue + messages = history.get("messages", {}) + if not isinstance(messages, dict): + continue for message_id, message in messages.items(): if not isinstance(message, dict):