Skip to content

Commit 4f2b87f

Browse files
authored
Merge pull request #130 from willtemperley/master
test case for polyline buffer which throws npe
2 parents 3858559 + a943547 commit 4f2b87f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/main/java/com/esri/core/geometry/Bufferer.java

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ private Geometry bufferPoint_() {
805805

806806
private Geometry bufferPoint_(Point point) {
807807
assert (m_distance > 0);
808-
Polygon resultPolygon = new Polygon(m_geometry.getDescription());
808+
Polygon resultPolygon = new Polygon(point.getDescription());
809809
addCircle_((MultiPathImpl) resultPolygon._getImpl(), point);
810810
return setStrongSimple_(resultPolygon);
811811
}

src/test/java/com/esri/core/geometry/TestBuffer.java

100644100755
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ public void testBufferPolyline() {
266266
assertTrue(Math.abs(pointCount - 208.0) < 10);
267267
assertTrue(simplify.isSimpleAsFeature(result, sr, null));
268268
}
269+
270+
{
271+
inputGeom = new Polyline();
272+
inputGeom.startPath(1.762614,0.607368);
273+
inputGeom.lineTo(1.762414,0.606655);
274+
inputGeom.lineTo(1.763006,0.607034);
275+
inputGeom.lineTo(1.762548,0.607135);
276+
277+
Geometry result = buffer.execute(inputGeom, sr, 0.005, null);
278+
assertTrue(simplify.isSimpleAsFeature(result, sr, null));
279+
}
269280
}
270281

271282
@Test

0 commit comments

Comments
 (0)