Skip to content

Commit 848a028

Browse files
committed
Fix Conversion.toGeometryCollection for null first arg
1 parent f568af7 commit 848a028

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/app/src/main/java/org/locationtech/jtstest/function/ConversionFunctions.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ public static Geometry toMultiPolygon(Geometry g1, Geometry g2)
7373
.createMultiPolygon( GeometryFactory.toPolygonArray(polys));
7474
}
7575

76-
public static Geometry toGeometryCollection(Geometry g, Geometry g2)
76+
public static Geometry toGeometryCollection(Geometry g1, Geometry g2)
7777
{
7878
List atomicGeoms = new ArrayList();
79-
if (g != null) addComponents(g, atomicGeoms);
79+
if (g1 != null) addComponents(g1, atomicGeoms);
8080
if (g2 != null) addComponents(g2, atomicGeoms);
81-
return g.getFactory().createGeometryCollection(
81+
return FunctionsUtil.getFactoryOrDefault(g1, g2).createGeometryCollection(
8282
GeometryFactory.toGeometryArray(atomicGeoms));
8383
}
8484

0 commit comments

Comments
 (0)