Skip to content

Commit

Permalink
Fix: Filter empty groups when exporting per/group
Browse files Browse the repository at this point in the history
  • Loading branch information
SonarSonic committed Jul 31, 2024
1 parent 287fa1d commit fea12a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/drawingbot/files/ExportTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.stream.Collectors;

public class ExportTask extends DBTask<Boolean> {

Expand Down Expand Up @@ -165,7 +166,7 @@ protected Boolean call() throws InterruptedException, ExecutionException {
doExport(geometryFilter, saveLocation);
break;
case PER_GROUP:
Collection<PlottedGroup> groups = plottedDrawing.groups.values();
Collection<PlottedGroup> groups = plottedDrawing.groups.values().stream().filter(g->!g.geometries.isEmpty()).collect(Collectors.toSet());
int groupPos = 0;
for(PlottedGroup group : groups){
updateTitle(exportHandler.description + ": " + (groupPos+1) + " / " + groups.size() + " - " + saveLocation.getPath());
Expand Down

0 comments on commit fea12a4

Please sign in to comment.