mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix:valueERROR when file is optional but not exist value (#9414)
### What problem does this PR solve? when begin component has optional file but not exist , it rase error ### Type of change - [x] Bug Fix Co-authored-by: Popmio <zhengyihao036@gamil.com>
This commit is contained in:
@ -39,7 +39,10 @@ class Begin(UserFillUp):
|
||||
def _invoke(self, **kwargs):
|
||||
for k, v in kwargs.get("inputs", {}).items():
|
||||
if isinstance(v, dict) and v.get("type", "").lower().find("file") >=0:
|
||||
v = self._canvas.get_files([v["value"]])
|
||||
if v.get("optional") and v.get("value", None) is None:
|
||||
v = None
|
||||
else:
|
||||
v = self._canvas.get_files([v["value"]])
|
||||
else:
|
||||
v = v.get("value")
|
||||
self.set_output(k, v)
|
||||
|
||||
Reference in New Issue
Block a user