mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #24813] [CLOSED] [JAWA-1197] Guard chat_id NoneType in startswith calls #131530
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24813
Author: @JawafdehiBot
Created: 5/16/2026
Status: ❌ Closed
Base:
main← Head:fix/chat-id-startswith-none-JAWA-1197📝 Commits (1)
6108178fix: guard chat_id NoneType in startswith calls📊 Changes
1 file changed (+10 additions, -10 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+10 -10)📄 Description
Summary
Prevent
'NoneType' object has no attribute 'startswith'crashes whenmetadata['chat_id']is None.Changes
In
backend/open_webui/utils/middleware.py, replaced all 10 occurrences ofmetadata['chat_id'].startswith(...)withmetadata.get('chat_id', '').startswith(...)across:background_tasks_handler(1 call site forchannel:, 1 forlocal:)non_streaming_chat_response_handler(4 call sites forchannel:)streaming_chat_response_handler(4 call sites forchannel:)Related
Rollback
Revert this commit or apply the inverse diff to restore previous behaviour. No migration or config changes needed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.