From bd35919a2093df7a7c21eeb698b4498e44543c9a Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Thu, 5 Oct 2023 15:07:02 +0300 Subject: [PATCH] Update src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs Co-authored-by: Eastman --- src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs b/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs index c9b1e4e2f0..ba248fa6c8 100644 --- a/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs +++ b/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs @@ -479,8 +479,7 @@ private static CodeTypeBase ConvertComposedTypeToWrapper(CodeClass codeClass, Co if (!supportsInnerClasses) { var @namespace = codeClass.GetImmediateParentOfType(); - var existingClass = @namespace.FindChildByName(codeComposedType.Name, false); - if (existingClass != null && existingClass.OriginalComposedType == null) + if (@namespace.FindChildByName(codeComposedType.Name, false) is CodeClass { OriginalComposedType: null }) codeComposedType.Name = $"{codeComposedType.Name}Wrapper"; newClass = @namespace.AddClass(new CodeClass {