From 4f06170da8439370fdcacbc00f54f55594028185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 28 Oct 2023 12:00:33 +0200 Subject: [PATCH] Add nullcheck to TychoMirrorApplication it seems in some error conditions it is possible that a null is returned. --- .../eclipse/tycho/p2tools/TychoMirrorApplication.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/TychoMirrorApplication.java b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/TychoMirrorApplication.java index dd0780f352..e31a9f60a8 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/TychoMirrorApplication.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/TychoMirrorApplication.java @@ -217,10 +217,13 @@ private static URI getNormalizedLocation(RepositoryReference r) { @Override protected void finalizeRepositories() { - Collection 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 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(); }