Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Nest/QueryDsl/Geo/GeoLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static GeoLocation TryCreate(double latitude, double longitude)

public override string ToString()
{
return _latitude.ToString("#0.0#######") + "," + _longitude.ToString("#0.0#######");
return _latitude.ToString("#0.0#######", CultureInfo.InvariantCulture) + "," + _longitude.ToString("#0.0#######", CultureInfo.InvariantCulture);
}

public bool Equals(GeoLocation other)
Expand Down Expand Up @@ -128,7 +128,9 @@ public static implicit operator GeoLocation(string latLon)

public static implicit operator GeoLocation(double[] lonLat)
{
if (lonLat.Length != 2) throw new ArgumentException("Invalid lon,lat array, must have a length of 2");
if (lonLat.Length != 2)
return null;

return new GeoLocation(lonLat[1], lonLat[0]);
}
}
Expand All @@ -151,4 +153,4 @@ public static implicit operator GeoCoordinate(double[] coordinates)
return new GeoCoordinate(coordinates[0], coordinates[1]);
}
}
}
}