diff --git a/fred.py b/fred.py index 3112599..d4ad47e 100644 --- a/fred.py +++ b/fred.py @@ -66,6 +66,8 @@ def toGrid(input, parser=None): FileNotFoundError: If the file cannot be found (if input is a file path). ValueError: If the parser function is invalid. """ + if parser is not None and not callable(parser): + raise ValueError("The parser must be a callable function.") grid = [] try: