make variables access robuster (#3406)

### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
This commit is contained in:
Kevin Hu
2024-11-14 18:28:41 +08:00
committed by GitHub
parent e4c4fdabbd
commit 30c1f7ee29
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class Generate(ComponentBase):
component_name = "Generate"
def get_dependent_components(self):
cpnts = [para["component_id"] for para in self._param.parameters if para["component_id"].lower().find("answer") < 0]
cpnts = [para["component_id"] for para in self._param.parameters if para.get("component_id") and para["component_id"].lower().find("answer") < 0]
return cpnts
def set_cite(self, retrieval_res, answer):