Fixed null reference in test-salt-formulas pipeline

Change-Id: I80ec9d4285010c4f70c679598bceeb8701afdbaf
diff --git a/abort-long-running-jobs.groovy b/abort-long-running-jobs.groovy
index 6269528..0a5fa2a 100644
--- a/abort-long-running-jobs.groovy
+++ b/abort-long-running-jobs.groovy
@@ -8,7 +8,6 @@
 
 node{
   stage("Kill long running jobs"){
-    def jobKilled = false
     for (int i=0; i < Jenkins.instance.items.size(); i++) {
       if(!jenkinsUtils.killStuckBuilds(3600 * Integer.parseInt(MAX_DURATION_IN_HOURS), Jenkins.instance.items[i])){
          common.errorMsg("Kill failed!")
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index cded75c..d305b16 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -95,7 +95,7 @@
         }
         common.infoMsg("Running kitchen testing, parallel mode: " + KITCHEN_TESTS_PARALLEL.toBoolean())
         wrap([$class: 'AnsiColorBuildWrapper']) {
-          if(!kitchenEnvs.isEmpty()){
+          if(kitchenEnvs && !kitchenEnvs.isEmpty()){
             common.infoMsg("Found multiple environment, first running kitchen without custom env")
             ruby.runKitchenTests("", KITCHEN_TESTS_PARALLEL.toBoolean())
             for(int i=0;i<kitchenEnvs.size();i++){