Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] +Fix. Path.Data crashing when geometry has a PolyLineSegment with 0 point #13159

Closed
softlion opened this issue Dec 16, 2020 · 1 comment · Fixed by #13161
Closed

[Bug] +Fix. Path.Data crashing when geometry has a PolyLineSegment with 0 point #13159

softlion opened this issue Dec 16, 2020 · 1 comment · Fixed by #13161
Assignees
Labels
a/shapes e/2 🕑 2 in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛

Comments

@softlion
Copy link
Contributor

softlion commented Dec 16, 2020

Description

When Path.Data is set to a geometry containing a PolyLineSegment with 0 point, it crashes

Looking into source line 93 of GeometryExtensions.cs:

https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.iOS/Extensions/GeometryExtensions.cs

                        else if (pathSegment is PolyLineSegment)
                        {
                            PolyLineSegment polylineSegment = pathSegment as PolyLineSegment;
                            PointCollection points = polylineSegment.Points;

                            for (int i = 0; i < points.Count; i++)
                                pathData.Data.AddLineToPoint(transform, points[i].ToPointF());

                            lastPoint = points[points.Count - 1];
                        }

If polylineSegment.Points.Count is 0, then the last line crashes (points[points.Count - 1];)

Basic Information

  • Version with issue: 5 prerelease
  • Last known good version: none
  • Platform Target Frameworks:
    • iOS
@softlion softlion added s/unverified New report that has yet to be verified t/bug 🐛 labels Dec 16, 2020
@softlion softlion changed the title [Bug] +Fix. Path.Data [Bug] +Fix. Path.Data crashing when geometry has a PolyLineSegment with 0 point Dec 16, 2020
@jsuarezruiz jsuarezruiz self-assigned this Dec 16, 2020
@jsuarezruiz jsuarezruiz added e/2 🕑 2 and removed s/unverified New report that has yet to be verified labels Dec 16, 2020
@jsuarezruiz jsuarezruiz added the in-progress This issue has an associated pull request that may resolve it! label Dec 16, 2020
@jsuarezruiz
Copy link
Contributor

Thanks for the detailed feedback. The bug will be fixed by #13161

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shapes e/2 🕑 2 in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants