From 70f819928701df6a95df5faae2942301c3dc625d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 1 Aug 2023 11:09:04 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20set=20default?= =?UTF-8?q?=20value=20of=20boolean=20custom=20field=20to=20False=20if=20va?= =?UTF-8?q?lue=20is=20None=20to=20prevent=20potential=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 56410348b..1420479a4 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -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)