From ebcebf1d8179af6acfdad8174aefdc074ec8dea9 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Fri, 4 Oct 2024 10:46:06 +0200 Subject: [PATCH] When generating toitdoc be more robust if a package.yaml is bad. (#2561) --- tools/toitdoc/toitdoc.toit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/toitdoc/toitdoc.toit b/tools/toitdoc/toitdoc.toit index 2d14cf28e..6840dbc36 100644 --- a/tools/toitdoc/toitdoc.toit +++ b/tools/toitdoc/toitdoc.toit @@ -233,7 +233,7 @@ toitdoc invocation/cli.Invocation --toitc/string --sdk-path/string? --output/str print "No package.yaml found at $package-yaml-path." exit 1 content := yaml.decode (file.read-content package-yaml-path) - if not content.contains "name": + if content is not Map or not content.contains "name": print "No 'name' field found in package.yaml." exit 1 pkg-name = kebabify content["name"]