We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58e3cd6 commit 4ff2176Copy full SHA for 4ff2176
src/Microsoft.OpenApi/Models/OpenApiSchema.cs
@@ -767,17 +767,18 @@ private object DeepCloneType(object type)
767
return type; // Return the string as is
768
}
769
770
- else
+ if (type is Array array)
771
{
772
- var array = type as Array;
773
Type elementType = type.GetType().GetElementType();
774
Array copiedArray = Array.CreateInstance(elementType, array.Length);
775
- for (int i = 0; i < array.Length; i++)
+ for (int i = 0; i < array?.Length; i++)
776
777
- copiedArray.SetValue(DeepCloneType(array.GetValue(i)), i);
+ copiedArray.SetValue(DeepCloneType(array?.GetValue(i)), i);
778
779
return copiedArray;
780
+
781
+ return null;
782
783
784
0 commit comments