mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-26 10:59:28 +08:00
🐛 fix(types.py): set default value of boolean custom field to False if value is None to prevent potential errors
This commit is contained in:
@ -101,6 +101,9 @@ def add_new_custom_field(
|
||||
field_value = field_config.pop("value", field_value)
|
||||
field_advanced = field_config.pop("advanced", False)
|
||||
|
||||
if field_type == "bool" and field_value is None:
|
||||
field_value = False
|
||||
|
||||
# If options is a list, then it's a dropdown
|
||||
# If options is None, then it's a list of strings
|
||||
is_list = isinstance(field_config.get("options"), list)
|
||||
|
||||
Reference in New Issue
Block a user