Skip to content

Commit

Permalink
Add nullcheck to TychoMirrorApplication
Browse files Browse the repository at this point in the history
it seems in some error conditions it is possible that a null is
returned.
  • Loading branch information
laeubi committed Oct 28, 2023
1 parent 616d8d0 commit 4f06170
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,13 @@ private static URI getNormalizedLocation(RepositoryReference r) {

@Override
protected void finalizeRepositories() {
Collection<IRepositoryReference> references = getDestinationMetadataRepository().getReferences();
if (!references.isEmpty()) {
LOGGER.info("Adding references to the following repositories:");
references.stream().map(r -> r.getLocation()).distinct().forEach(loc -> LOGGER.info(" {}", loc));
IMetadataRepository repository = getDestinationMetadataRepository();
if (repository != null) {
Collection<IRepositoryReference> references = repository.getReferences();
if (!references.isEmpty()) {
LOGGER.info("Adding references to the following repositories:");
references.stream().map(r -> r.getLocation()).distinct().forEach(loc -> LOGGER.info(" {}", loc));
}
}
super.finalizeRepositories();
}
Expand Down

0 comments on commit 4f06170

Please sign in to comment.