Skip to content

Commit

Permalink
correctly handle null features in CityJSONWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
clausnagel committed Nov 25, 2023
1 parent 220f118 commit 70f2e91
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ public CompletableFuture<Boolean> write(Feature feature) throws WriteException {
countLatch.increment();
service.execute(() -> {
try {
writer.writeCityObject(helpers.get().getTopLevelFeature(feature));
result.complete(true);
AbstractFeature converted = helpers.get().getTopLevelFeature(feature);
if (converted != null) {
writer.writeCityObject(converted);
result.complete(true);
} else {
result.complete(false);
}
} catch (Throwable e) {
shouldRun = false;
result.completeExceptionally(new WriteException("Failed to write feature.", e));
Expand Down

0 comments on commit 70f2e91

Please sign in to comment.