-
-
Notifications
You must be signed in to change notification settings - Fork 52
Fix NoneType errors in Gemini pipeline metadata and file handling #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When no filters are installed or Open WebUI doesn't provide the __metadata__
parameter, it can be None, causing "'NoneType' object has no attribute 'get'" error.
Added defensive check: metadata = __metadata__ or {}
This ensures metadata is always a dict, even when __metadata__ is None.
Co-authored-by: owndev <69784886+owndev@users.noreply.github.com>
…eError
The error "'NoneType' object has no attribute 'get'" was still occurring
because file_obj.meta could be None when accessing the content_type.
Added defensive check: mime = (file_obj.meta or {}).get("content_type", "image/png")
This ensures file_obj.meta is treated as an empty dict when None.
Bumped version from 1.11.2 to 1.11.3
Co-authored-by: owndev <69784886+owndev@users.noreply.github.com>
|
@codex[agent] The problem still exists: 'NoneType' object has no attribute 'get' |
|
@copilot The problem still exists: 'NoneType' object has no attribute 'get' |
I've identified and fixed the root causes. The issue was that Fixed in this commit:
The fixes follow the Azure pipeline pattern of checking |
Complete Fix for All NoneType Errors
Root Cause Analysis
The error "'NoneType' object has no attribute 'get'" was occurring because:
__user__["id"]accessed without None check at line 2407 and 1571__event_emitter__()called without None checks in 15 locationsComprehensive Fix
__user__["id"]access in pipe() method (line 2407)__user__["id"]access in _upload_image_with_status (line 1571) with fallback__event_emitter__()calls with None checksChanges by Method
pipe() method:
_upload_image_with_status:
All event emitters:
Type hints updated:
__metadata__: dict[str, Any]→Optional[dict[str, Any]] = None__event_emitter__: Callable→Optional[Callable] = None(6 methods)__user__: dict→Optional[dict] = None(1 method)Pattern Followed
This fix follows the established pattern from the Azure AI Foundry pipeline, which consistently checks
if __event_emitter__:before all calls.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.