From 39e92371b0a3c41d755db71c019d76a2be3c52a9 Mon Sep 17 00:00:00 2001 From: Daniel Anechitoaie Date: Tue, 3 Jul 2018 00:13:42 +0300 Subject: [PATCH] Fixed NullPointerException --- .../dataimport/DataImportBuilder.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/dataimport/DataImportBuilder.java b/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/dataimport/DataImportBuilder.java index 363aaee..1c30b07 100644 --- a/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/dataimport/DataImportBuilder.java +++ b/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/dataimport/DataImportBuilder.java @@ -305,9 +305,12 @@ public void perform( List previousDataFingerprints = new ArrayList<>(); Run previousBuild = build.getPreviousBuild(); if (previousBuild != null) { - previousBuild.getActions(DataImportAction.class).forEach( - (dataImportAction) -> previousDataFingerprints.addAll(dataImportAction.getDataFingerprints()) - ); + previousBuild.getActions(DataImportAction.class).forEach((dataImportAction) -> { + List dataFingerprints = dataImportAction.getDataFingerprints(); + if (dataFingerprints != null && !dataFingerprints.isEmpty()) { + previousDataFingerprints.addAll(dataFingerprints); + } + }); } DataImportResult dataImportResult = workspace.act(new DataImportCallable(