diff --git a/openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java b/openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java index d537165d0a..61ca1e6a13 100644 --- a/openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java +++ b/openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java @@ -436,8 +436,15 @@ public InjectStatusCommandLine getCommandsLinesFromInject(final Inject inject) { // Inject has a command payload Payload payload = injectorContract.getPayload(); Command payloadCommand = (Command) Hibernate.unproxy(payload); - return new InjectStatusCommandLine(!payloadCommand.getContent().isBlank() ? List.of(payloadCommand.getContent()) : null, - !payloadCommand.getCleanupCommand().isBlank() ? List.of(payload.getCleanupCommand()) : null, payload.getExternalId()); + return new InjectStatusCommandLine( + payloadCommand.getContent() != null && !payloadCommand.getContent().isBlank() + ? List.of(payloadCommand.getContent()) + : null, + payloadCommand.getCleanupCommand() != null && !payloadCommand.getCleanupCommand().isBlank() + ? List.of(payloadCommand.getCleanupCommand()) + : null, + payload.getExternalId() + ); } else { // Inject comes from Caldera ability and tomorrow from other(s) Executor(s) io.openbas.execution.Injector executor = context.getBean(injectorContract.getInjector().getType(), io.openbas.execution.Injector.class);