From 6aac7e8e80302da478484ab57deedf6532e788f3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 8 Jul 2023 14:57:22 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20add=20a=20check?= =?UTF-8?q?=20for=20None=20before=20checking=20if=20the=20built=20object?= =?UTF-8?q?=20has=20a=20"format"=20attribute=20to=20prevent=20potential=20?= =?UTF-8?q?AttributeError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/graph/vertex/types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index 9f57ed09b..2bebc1383 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -211,7 +211,11 @@ class PromptVertex(Vertex): return self._built_object def _built_object_repr(self): - if self.artifacts and hasattr(self._built_object, "format"): + if ( + self.artifacts + and self._built_object is not None + and hasattr(self._built_object, "format") + ): # We'll build the prompt with the artifacts # to show the user what the prompt looks like # with the variables filled in