TPC4 Fix listas sem funcao

This commit is contained in:
Afonso Franco 2023-03-18 17:59:19 +00:00
parent 7b6e7ea36a
commit 09d3d57fa9
Signed by: afonso
SSH key fingerprint: SHA256:JiuxZNdA5bRWXPMUJChI0AQ75yC+cXY4xM0IaVwEVys
3 changed files with 20 additions and 5 deletions

View file

@ -54,7 +54,7 @@ def read_header(file: str) -> list[Field]:
if max_size is None:
max_size = min_size
# Check if the list has a valid function
if function not in valid_functions:
if function is not None and function not in valid_functions:
raise ValueError(f"Invalid function: {function}")
parsed_headers.append(
ListField(name, int(min_size), int(max_size), function)