Issue #140: check for an empty scheme file.

This commit is contained in:
Sergey Vartanov 2022-08-19 10:56:09 +03:00
parent a6955c7d22
commit cb1bdceedb
2 changed files with 12 additions and 5 deletions

View file

@ -267,7 +267,9 @@ def render_map(arguments: argparse.Namespace) -> None:
if scheme_path is None:
fatal(f"Scheme `{arguments.scheme}` not found.")
scheme: Scheme = Scheme.from_file(scheme_path)
scheme: Optional[Scheme] = Scheme.from_file(scheme_path)
if scheme is None:
fatal(f"Failed to load scheme from `{arguments.scheme}`.")
configuration: MapConfiguration = MapConfiguration.from_options(
scheme, arguments, float(arguments.zoom)