We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eee8998 commit 6b6e584Copy full SHA for 6b6e584
1 file changed
src/PolylineAlgorithm/Coordinate.cs
@@ -43,11 +43,11 @@ public Coordinate() {
43
/// or when <paramref name="longitude"/> is less than -180 or greater than 180.
44
/// </exception>
45
public Coordinate(double latitude, double longitude) {
46
- if (latitude < -90 || latitude > 90) {
+ if (latitude < -90 || latitude > 90 || double.IsNaN(latitude) || double.IsInfinity(latitude)) {
47
throw new ArgumentOutOfRangeException(nameof(latitude), "Latitude must be between -90 and 90.");
48
}
49
50
- if (longitude < -180 || longitude > 180) {
+ if (longitude < -180 || longitude > 180 || double.IsNaN(longitude) || double.IsInfinity(longitude)) {
51
throw new ArgumentOutOfRangeException(nameof(longitude), "Longitude must be between -180 and 180.");
52
53
0 commit comments