fix: type error in list-operator (#22803)
This commit is contained in:
parent
c6d7328e15
commit
371fe7a700
5 changed files with 3 additions and 8 deletions
|
|
@ -184,11 +184,10 @@ class ListOperatorNode(BaseNode):
|
|||
value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text)
|
||||
if value < 1:
|
||||
raise ValueError(f"Invalid serial index: must be >= 1, got {value}")
|
||||
if value > len(variable.value):
|
||||
raise InvalidKeyError(f"Invalid serial index: must be <= {len(variable.value)}, got {value}")
|
||||
value -= 1
|
||||
if len(variable.value) > int(value):
|
||||
result = variable.value[value]
|
||||
else:
|
||||
result = ""
|
||||
result = variable.value[value]
|
||||
return variable.model_copy(update={"value": [result]})
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue