From 14c825133003f2ac280dc0edfbdb5b1c611a3125 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 18 Jul 2023 13:44:12 -0700 Subject: [PATCH] Fix warning with generated converter code --- generator/plugins/dotnet/dotnet_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/plugins/dotnet/dotnet_classes.py b/generator/plugins/dotnet/dotnet_classes.py index 2e598ce..d16dd77 100644 --- a/generator/plugins/dotnet/dotnet_classes.py +++ b/generator/plugins/dotnet/dotnet_classes.py @@ -476,7 +476,7 @@ def generate_type_alias_converter( ] for t in subset_types: code += [ - f"if (orType.Value.GetType() == typeof({t}))", + f"if (orType.Value?.GetType() == typeof({t}))", "{", f"return new {type_def.name}(({t})orType.Value);", "}",