Fix empty records bug and return empty string if state is not found
This commit is contained in:
parent
d4cad81302
commit
48ec2d2fa8
2 changed files with 3 additions and 1 deletions
|
|
@ -25,6 +25,8 @@ class RecordsAsTextComponent(CustomComponent):
|
|||
records: list[Record],
|
||||
template: str = "Text: {text}\nData: {data}",
|
||||
) -> Text:
|
||||
if not records:
|
||||
return ""
|
||||
if isinstance(records, Record):
|
||||
records = [records]
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class GraphStateManager:
|
|||
|
||||
def get_state(self, key):
|
||||
with self.lock:
|
||||
return self.states.get(key, None)
|
||||
return self.states.get(key, "")
|
||||
|
||||
def subscribe(self, key, observer: Callable):
|
||||
with self.lock:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue