{"record":{"id":"49556d7817ee7a34","repo":"AvaloniaUI/Avalonia","slug":"points","errorCode":null,"errorMessage":"points","messagePattern":"points","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Media/PolyBezierSegment.cs","lineNumber":31,"sourceCode":"    /// Points DirectProperty definition\n    /// </summary>\n    public static readonly DirectProperty<PolyBezierSegment, Points?> PointsProperty =\n        AvaloniaProperty.RegisterDirect<PolyBezierSegment, Points?>(nameof(Points),\n            o => o.Points,\n            (o, v) => o.Points = v);\n\n    private Points? _points = [];\n\n    public PolyBezierSegment()\n    {\n\n    }\n\n    public PolyBezierSegment(IEnumerable<Point> points, bool isStroked)\n    {\n        if (points is null)\n        {\n            throw new ArgumentNullException(nameof(points));\n        }\n\n        Points = new Points(points);\n        IsStroked = isStroked;\n    }\n\n    /// <summary>\n    /// Gets or sets the Point collection that defines this <see cref=\"PolyBezierSegment\"/> object.\n    /// </summary>\n    /// <value>\n    /// The points.\n    /// </value>\n    [Metadata.Content]\n    public Points? Points\n    {\n        get => _points;\n        set => SetAndRaise(PointsProperty, ref _points, value);\n    }","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Media/PolyBezierSegment.cs#L13-L49","documentation":"Thrown by the PolyBezierSegment constructor (the overload taking IEnumerable<Point> and isStroked) when the points argument is null. The segment immediately wraps the sequence in a Points collection, which cannot be built from null.","triggerScenarios":"new PolyBezierSegment(null, isStroked) — passing a null point sequence.","commonSituations":"Binding or constructing a PolyBezierSegment from a source collection that is null; forgetting to initialize the points list before building the segment.","solutions":["Pass a non-null IEnumerable<Point> (e.g. an array or List<Point>); an empty sequence is acceptable.","Use the parameterless constructor and set Points afterward if the collection may be unavailable at construction time.","Null-check the source before constructing the segment."],"exampleFix":"// before\nvar seg = new PolyBezierSegment(maybeNullPoints, true);\n\n// after\nvar seg = new PolyBezierSegment(maybeNullPoints ?? Array.Empty<Point>(), true);","handlingStrategy":"validation","validationCode":"var pts = points ?? Array.Empty<Point>();\nvar seg = new PolyBezierSegment(pts, isStroked);","typeGuard":"static bool HasPoints(IEnumerable<Point>? p) => p is not null;","tryCatchPattern":null,"preventionTips":["Coalesce null sequences to an empty collection before constructing the segment.","Prefer the parameterless constructor plus Points setter when the source may be null."],"tags":["avalonia","path-segment","bezier","null-argument","constructor"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}