title: Jenkins pipeline - Cannot invoke method stage() on null object
body: <p>I have a pipeline script like this: </p>
  
  <pre><code>node('linux'){
    stage('Setup'){
      echo "Build Stage"
  
    } stage('Build'){
        echo "Build Stage"
  
    } stage('Test'){
        echo "Test Stage"
    }  
  }
  </code></pre>
  
  <p>The <code>Setup</code> stage runs fine but an exception is thrown after that</p>
  
  <pre><code>java.lang.NullPointerException: Cannot invoke method stage() on null object
  at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159)
  at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
  at WorkflowScript.run(WorkflowScript:2)
  at ___cps.transform___(Native Method)
  at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
  </code></pre>
  
  <p>what could be wrong?</p>