From c1c6e7d2125982f6daa6e37318069210248a9cd9 Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Mon, 28 Aug 2023 18:21:14 +0200 Subject: [PATCH] fix: warn if root component is not present --- .../src/main/java/io/github/algomaster99/Options.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/watchdog-agent/src/main/java/io/github/algomaster99/Options.java b/watchdog-agent/src/main/java/io/github/algomaster99/Options.java index 5ed0023f..7d50f973 100644 --- a/watchdog-agent/src/main/java/io/github/algomaster99/Options.java +++ b/watchdog-agent/src/main/java/io/github/algomaster99/Options.java @@ -111,6 +111,10 @@ public Path getOutput() { private void processRootComponent(Bom14Schema sbom) throws IOException, InterruptedException { Component rootComponent = sbom.getMetadata().getComponent(); + if (rootComponent == null) { + LOGGER.warn("Root component is not present."); + return; + } File jarFile = JarDownloader.getMavenJarFile( rootComponent.getGroup(), rootComponent.getName(), rootComponent.getVersion()); goInsideJarAndUpdateFingerprints(