Treat empty string (frontend default) or empty list as unset has a bug #21018

Closed
opened 2026-02-21 20:10:16 -05:00 by yindo · 1 comment
Owner

Originally created by @wuleidapao on GitHub (Dec 12, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

file: base_app_generator.py
if not value and isinstance(value, (str, list)): return None

If the ‘’value‘’ here is an empty file list [], such a processed 'none' value will cause subsequent document_extractor components to report an error: unsupported variable type:<class' NoneType '>

Image

✔️ Expected Behavior

Allow file list values to be []

Actual Behavior

No response

Originally created by @wuleidapao on GitHub (Dec 12, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce file: base_app_generator.py `if not value and isinstance(value, (str, list)): return None` If the ‘’value‘’ here is an empty file list [], such a processed 'none' value will cause subsequent document_extractor components to report an error: unsupported variable type:<class' NoneType '> <img width="1461" height="858" alt="Image" src="https://github.com/user-attachments/assets/8de5c0f4-0674-42e7-b326-22b4f5bd55b0" /> ### ✔️ Expected Behavior Allow file list values to be [] ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:10:16 -05:00
yindo closed this issue 2026-02-21 20:10:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 12, 2025):

This bug has been fixed in a recent merged pull request: #28948. The fix ensures that empty strings (frontend default) or empty lists are treated as unset (return None) only for optional file inputs (FILE and FILE_LIST) that are not required. This prevents downstream errors in document extraction components, which expect a list or file instance and do not handle None gracefully.

Unit tests were added to verify that optional file variables with empty string or empty list values both return None, while required file variables with empty values still fail validation as expected. If you're running v1.11.0, you should update to a version including this fix or manually apply the patch to avoid this issue. You can find the details and code changes in the merged PR.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 12, 2025): <!-- Answer --> This bug has been fixed in a recent merged pull request: [#28948](https://github.com/langgenius/dify/pull/28948). The fix ensures that empty strings (frontend default) or empty lists are treated as unset (return `None`) only for optional file inputs (`FILE` and `FILE_LIST`) that are not required. This prevents downstream errors in document extraction components, which expect a list or file instance and do not handle `None` gracefully. Unit tests were added to verify that optional file variables with empty string or empty list values both return `None`, while required file variables with empty values still fail validation as expected. If you're running v1.11.0, you should update to a version including this fix or manually apply the patch to avoid this issue. You can find the details and code changes in the [merged PR](https://github.com/langgenius/dify/pull/28948). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a2982a62-8cdd-49d2-bed7-17f08f2782d4?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20bug%20has%20been%20fixed%20in%20a%20recent%20merged%20pull%20request%3A%20%5B%2328948%5D%28https%3A//github.com/langgenius/dify/pull/28948%29.%20The%20fix%20ensures%20that%20empty%20strings%20%28frontend%20default%29%20or%20empty%20lists%20are%20treated%20as%20unset%20%28return%20%60None%60%29%20only%20for%20optional%20file%20inputs%20%28%60FILE%60%20and%20%60FILE_LIST%60%29%20that%20are%20not%20required.%20This%20prevents%20downstream%20errors%20in%20document%20extraction%20components%2C%20which%20expect%20a%20list%20or%20file%20instance%20and%20do%20not%20handle%20%60None%60%20gracefully.%0A%0AUnit%20tests%20were%20added%20to%20verify%20that%20optional%20file%20variables%20with%20empty%20string%20or%20empty%20list%20values%20both%20return%20%60None%60%2C%20while%20required%20file%20variables%20with%20empty%20values%20still%20fail%20validation%20as%20expected.%20If%20you%27re%20running%20v1.11.0%2C%20you%20should%20update%20to%20a%20version%20including%20this%20fix%20or%20manually%20apply%20the%20patch%20to%20avoid%20this%20issue.%20You%20can%20find%20the%20details%20and%20code%20changes%20in%20the%20%5Bmerged%20PR%5D%28https%3A//github.com/langgenius/dify/pull/28948%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29598)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21018