Skip to content

Commit

Permalink
fix(framework:skip) Check list length before access
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Sep 9, 2024
1 parent 9afe0f8 commit 382834b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/py/flwr/client/client_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def _alert_erroneous_client_fn() -> None:

def _inspect_maybe_adapt_client_fn_signature(client_fn: ClientFnExt) -> ClientFnExt:
client_fn_args = inspect.signature(client_fn).parameters
first_arg = list(client_fn_args.keys())[0]

if len(client_fn_args) != 1:
_alert_erroneous_client_fn()

first_arg = list(client_fn_args.keys())[0]
first_arg_type = client_fn_args[first_arg].annotation

if first_arg_type is str or first_arg == "cid":
Expand Down

0 comments on commit 382834b

Please sign in to comment.