Skip to content

Commit

Permalink
Fix NPE when unexport Metadata Service (#6450)
Browse files Browse the repository at this point in the history
  • Loading branch information
tswstarplanet committed Jul 13, 2020
1 parent 58d5e51 commit a2e5102
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -74,6 +74,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.SortedSet;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -1005,10 +1006,10 @@ private void exportMetadataService() {
}

private void unexportMetadataService() {
metadataServiceExporters
.stream()
.filter(this::supports)
.forEach(MetadataServiceExporter::unexport);
Optional.ofNullable(metadataServiceExporters)
.ifPresent(set -> set.stream()
.filter(this::supports)
.forEach(MetadataServiceExporter::unexport));
}

private boolean supports(MetadataServiceExporter exporter) {
Expand Down

0 comments on commit a2e5102

Please sign in to comment.