Skip to content

Commit d07dbfa

Browse files
committed
do not lallow polygon free CSG ops
1 parent ae17d34 commit d07dbfa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/eu/mihosoft/vrl/v3d/CSGClient.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ private ArrayList<CSG> performOperation(List<CSG> csgList, CSGRemoteOperation op
146146

147147
ArrayList <CSG> toSend = new ArrayList<CSG>();
148148
for(CSG c:csgList) {
149-
CSG tmp = CSG.fromPolygons(new ArrayList<>(c.getPolygons()));
149+
List<Polygon> polygons = c.getPolygons();
150+
if(polygons.size()==0) {
151+
Exception ex = new Exception("No Polygons In Incoming geometry here!");
152+
ex.printStackTrace();
153+
throw ex;
154+
}
155+
CSG tmp = CSG.fromPolygons(new ArrayList<>(polygons));
150156
tmp.setOptType(c.getOptType());
151157
toSend.add(tmp);
152158
}

0 commit comments

Comments
 (0)