From b3266bab9c37d66fa2967850cfeb50203a325f4d Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Thu, 13 Jun 2024 16:30:29 -0300 Subject: [PATCH] refactor: Fix issue with handling None values in ResultData class Fix the issue where None values were not being handled correctly in the ResultData class. This ensures that the code properly handles cases where the message is None, preventing any potential errors or unexpected behavior. --- src/backend/base/langflow/graph/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/graph/schema.py b/src/backend/base/langflow/graph/schema.py index 0e99a5e84..825379800 100644 --- a/src/backend/base/langflow/graph/schema.py +++ b/src/backend/base/langflow/graph/schema.py @@ -35,8 +35,8 @@ class ResultData(BaseModel): message = values["artifacts"][key] # ! Temporary fix - if not isinstance(message, dict): - message = {"message": message} + if message is None: + continue if "stream_url" in message and "type" in message: stream_url = StreamURL(location=message["stream_url"])