File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,14 @@ public PolylineDecoder(PolylineEncodingOptions<Coordinate> options) {
4242 /// <returns>A <see cref="Coordinate"/> instance.</returns>
4343 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
4444 protected override Coordinate CreateCoordinate ( double latitude , double longitude ) {
45+ if ( ! Options . Validator . IsValidLatitude ( latitude ) ) {
46+ throw new ArgumentOutOfRangeException ( nameof ( latitude ) , latitude , "Latitude must be between -90 and 90 degrees." ) ;
47+ }
48+
49+ if ( ! Options . Validator . IsValidLongitude ( longitude ) ) {
50+ throw new ArgumentOutOfRangeException ( nameof ( longitude ) , longitude , "Longitude must be between -180 and 180 degrees." ) ;
51+ }
52+
4553 return new Coordinate ( latitude , longitude ) ;
4654 }
4755
You can’t perform that action at this time.
0 commit comments