Skip to content

Commit

Permalink
fix(component.py): add validation to ensure output method is a string…
Browse files Browse the repository at this point in the history
… to prevent potential runtime errors
  • Loading branch information
ogabrielluiz committed Aug 28, 2024
1 parent 90b41eb commit 98dab64
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ def _find_matching_output_method(self, value: "Component"):
f"There are multiple outputs from {value.__class__.__name__} that can connect to inputs in {self.__class__.__name__}: {matching_pairs_str}"
)
output, input_ = matching_pairs[0]
if not isinstance(output.method, str):
raise ValueError(f"Method {output.method} is not a valid output of {value.__class__.__name__}")
return getattr(value, output.method)

def _process_connection_or_parameter(self, key, value):
Expand Down

0 comments on commit 98dab64

Please sign in to comment.