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

@ -399,7 +399,7 @@ class ComponentBase(ABC):
self._param.check()
def get_dependent_components(self):
cpnts = [para["component_id"] for para in self._param.query if para["component_id"].lower().find("answer") < 0]
cpnts = [para["component_id"] for para in self._param.query if para.get("component_id") and para["component_id"].lower().find("answer") < 0]
return cpnts
def run(self, history, **kwargs):