[PR #31012] fix: validation error when uploading images with None URL values #33060

Closed
opened 2026-02-21 20:52:35 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/31012

State: closed
Merged: Yes


Fixes #30996

When users upload images using URL links in workflows, they get an "Invalid file url" validation error if the URL field is None. This happens because the code wasn't checking for None values before passing them to the File model validator.

This PR adds a simple validation check in build_from_mappings() to filter out mappings where the URL is None for remote_url transfers. Other transfer methods like local_file and tool_file aren't affected since they don't need URLs.

The validation just checks:

  • Is there a transfer_method?
  • If it's remote_url, is the url/remote_url field actually provided and not None?

If those checks fail, the mapping gets filtered out early instead of causing an error later.

Tested with various scenarios (None URLs, valid URLs, mixed mappings) and they all work as expected.

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=105917501

**Original Pull Request:** https://github.com/langgenius/dify/pull/31012 **State:** closed **Merged:** Yes --- Fixes #30996 When users upload images using URL links in workflows, they get an "Invalid file url" validation error if the URL field is None. This happens because the code wasn't checking for None values before passing them to the File model validator. This PR adds a simple validation check in build_from_mappings() to filter out mappings where the URL is None for remote_url transfers. Other transfer methods like local_file and tool_file aren't affected since they don't need URLs. The validation just checks: - Is there a transfer_method? - If it's remote_url, is the url/remote_url field actually provided and not None? If those checks fail, the mapping gets filtered out early instead of causing an error later. Tested with various scenarios (None URLs, valid URLs, mixed mappings) and they all work as expected. Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=105917501
yindo added the pull-request label 2026-02-21 20:52:35 -05:00
yindo closed this issue 2026-02-21 20:52:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33060