Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63356

Null pointer exception when declaring separator in scripted pipeline

XMLWordPrintable

      The following simple scripted pipeline:

       

      pipeline {
        agent any
        parameters {
          separator(name: "sep")
        }
        stages {
          stage("Build") {
            steps {
              echo "${params.sep}"
            }
          }
        }
      }
      

      fails with:

       

      java.lang.NullPointerException
      	at jenkins.plugins.parameter_separator.ParameterSeparatorDefinition.getComputedSeparatorStyle(ParameterSeparatorDefinition.java:98)
      	at jenkins.plugins.parameter_separator.ParameterSeparatorDefinition.getDefaultParameterValue(ParameterSeparatorDefinition.java:118)
      	at org.jenkinsci.plugins.workflow.cps.ParamsVariable.getValue(ParamsVariable.java:66)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
      	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
      	at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:354)
      	at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
      	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
      	at WorkflowScript.run(WorkflowScript:9)

       

       

            ppaczyn Piotr Paczyński
            ppaczyn Piotr Paczyński
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: