Skip to content

Commit aa151f1

Browse files
committed
add: assert messages when create polygon
1 parent 57ba3f1 commit aa151f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonPolygon.java

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ public List<GeoJsonLineString> getCoordinates() {
126126

127127
private static List<Point> asList(Point first, Point second, Point third, Point fourth, Point... others) {
128128

129+
Assert.notNull(first, "First point must not be null");
130+
Assert.notNull(second, "Second point must not be null");
131+
Assert.notNull(third, "Third point must not be null");
132+
Assert.notNull(fourth, "Fourth point must not be null");
133+
Assert.notNull(others, "Additional points must not be null");
134+
129135
ArrayList<Point> result = new ArrayList<Point>(4 + others.length);
130136

131137
result.add(first);

0 commit comments

Comments
 (0)