Skip to content

Commit

Permalink
Fix generate_list_convertor to handle empty value parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
solesensei committed Nov 27, 2024
1 parent e5d1236 commit 07350b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def generate_list_convertor(
convertor: Optional[Callable[[Any], Any]], default_value: Optional[Any]
) -> Callable[[Sequence[Any]], Optional[List[Any]]]:
def internal_convertor(value: Sequence[Any]) -> Optional[List[Any]]:
if default_value is None and len(value) == 0:
if default_value is None and (value is None or len(value) == 0):
return None
return [convertor(v) if convertor else v for v in value]

Expand Down

0 comments on commit 07350b5

Please sign in to comment.