mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
fix: setting file_handler in a filter would generate errors in messages with no files, because a "files: Null" in metadata would trigger an attempt to delete a non existent files object
This commit is contained in:
parent
031cf38655
commit
f9fd22d98e
1 changed files with 5 additions and 3 deletions
|
|
@ -127,8 +127,10 @@ async def process_filter_functions(
|
|||
raise e
|
||||
|
||||
# Handle file cleanup for inlet
|
||||
if skip_files and "files" in form_data.get("metadata", {}):
|
||||
del form_data["files"]
|
||||
if skip_files:
|
||||
if "files" in form_data.get("metadata", {}):
|
||||
del form_data["metadata"]["files"]
|
||||
if "files" in form_data:
|
||||
del form_data["files"]
|
||||
|
||||
return form_data, {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue