From bc415fd8a3b44b31b4b9e40920ab221dcdef45c2 Mon Sep 17 00:00:00 2001 From: Zoltan Lehoczky Date: Thu, 7 May 2026 23:48:12 +0200 Subject: [PATCH] Fix MA0194 in CodeGenerationDisplayDriver --- .../Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lombiq.HelpfulExtensions/Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs b/Lombiq.HelpfulExtensions/Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs index bf330c36..6ba422ad 100644 --- a/Lombiq.HelpfulExtensions/Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs +++ b/Lombiq.HelpfulExtensions/Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs @@ -176,7 +176,9 @@ private string ConvertJsonObject(JsonObject jsonObject, int indentationDepth) { var braceIndentation = new string(' ', indentationDepth); var propertyIndentation = new string(' ', indentationDepth + IndentationDepth); - if (jsonObject["name"] is { } name && jsonObject["value"] is { } value) + var nameNode = jsonObject["name"]; + var valueNode = jsonObject["value"]; + if (nameNode is { } name && valueNode is { } value) { var objectCodeBuilder = new StringBuilder(); objectCodeBuilder.AppendLine(CultureInfo.InvariantCulture, $"{braceIndentation}new ListValueOption");