Hey, I hope someone from Esri will see this question.
I added a part to a PolylineBuilderEx instance using AddPart(IEnumerable<MapPoint> points). In the points collection I had a couple of equal points going one after another. When I tried to call ToGeometry() to create a polyline out of it, I got an exception saying "Destination array was not long enough".
I decompiled ToGeometry method and started debugging it with a generated pdb. Turns out that ArcGIS.Core.Internal.Geometry.ShapeBufferHelper.GetMultipartBufferFromPartsSize doesn't include empty segments when calculating the buffer size:
if (segment.IsPoint)
--numPoints;
But then WriteSegmentToBuffer method is still called for every segment, empty or not. As a result we get an exception for not having enough space in the buffer.
This bug affects a lot of our code, so can you please fix this as soon as you can?
ArcGIS Pro version 3.0.2.