Fix NoneType errors in Gemini pipeline metadata and file handling#140
Closed
Fix NoneType errors in Gemini pipeline metadata and file handling#140
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>
Owner
|
@codex[agent] The problem still exists: 'NoneType' object has no attribute 'get' |
Copilot stopped work on behalf of
owndev due to an error
February 9, 2026 13:54
Owner
|
@copilot The problem still exists: 'NoneType' object has no attribute 'get' |
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.