🐛 fix(types.py): add a check for None before checking if the built object has a "format" attribute to prevent potential AttributeError
This commit is contained in:
parent
fbdde257e0
commit
6aac7e8e80
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue