eclipse/jbom

NullPointerException in case no components are found

Closed this issue · 1 comments

I get a NPE in case no components are found during analysis:
2022-10-05 13:59:30:713 TRACE --- [jbom] Analyzing file spsi085j-V235_29_0003.jar
2022-10-05 13:59:30:767 TRACE --- [jbom] Couldn't save SBOM to /home/rolf/workspace/javaserver/jbom/jbom-spsi085j-V235_29_0003.json
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because the return value of "com.contrastsecurity.CycloneDXModel.getComponents()" is null
at com.contrastsecurity.CycloneDXModel.save(CycloneDXModel.java:62)
at com.contrastsecurity.Libraries.save(Libraries.java:51)
at com.contrastsecurity.Jbom.doLocalFile(Jbom.java:198)
at com.contrastsecurity.Jbom.doLocalFile(Jbom.java:169)
at com.contrastsecurity.Jbom.run(Jbom.java:109)
at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at com.contrastsecurity.Jbom.main(Jbom.java:73)

Version: JBom 1.2
Environment: openjdk version "17.0.4.1" 2022-08-12 on Ubuntu 20.04

Fixed - see 1.2.1 release. Thanks!!