From 79009a659d4b8ab0865e10ef224f6237dc0ea82f Mon Sep 17 00:00:00 2001 From: Toastie <toastie@toastiet0ast.com> Date: Tue, 4 Feb 2025 20:00:15 +1300 Subject: [PATCH] Fixed NPE when there are no definitions set --- Commands/InterviewTemplateCommands.cs | 2 +- Interviews/interview_template.schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/InterviewTemplateCommands.cs b/Commands/InterviewTemplateCommands.cs index 336f93b..6c833c1 100644 --- a/Commands/InterviewTemplateCommands.cs +++ b/Commands/InterviewTemplateCommands.cs @@ -136,7 +136,7 @@ public class InterviewTemplateCommands List<string> errors = []; List<string> warnings = []; template.interview.Validate(ref errors, ref warnings, "interview", template.definitions); - foreach (KeyValuePair<string, InterviewStep> definition in template.definitions) + foreach (KeyValuePair<string, InterviewStep> definition in template.definitions ?? []) { definition.Value.Validate(ref errors, ref warnings, "definitions." + definition.Key, template.definitions); } diff --git a/Interviews/interview_template.schema.json b/Interviews/interview_template.schema.json index a27662c..572f146 100644 --- a/Interviews/interview_template.schema.json +++ b/Interviews/interview_template.schema.json @@ -223,6 +223,6 @@ } } }, - "required": [ "category-id", "interview" ], + "required": [ "category-id", "interview", "definitions" ], "unevaluatedProperties": false } \ No newline at end of file