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

Directive Generator produces NPE with `when --> allOf --> (nothing else)`

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins:
      - Core 2.127
      - Experimental UC plugins
      - Declarative at 1.3.0-SNAPSHOT, which was master at commit eeb92e42
    • Similar Issues:

      Description

      Summary
      When using the Directive Generator, building a when / allOf directive with no conditions attached produces a NPE. This was another accidental find.

      Steps to recreate
      1. Go to the Declarative Directive Generator via http://1.2.3.4:8080/job/your-pipeline-job/directive-generator/

      2. Set it up as follows:

      • Sample Directive: when
      • whenCondition: allOf
      • Execute the stage if all nested conditions are true: no selections made

      3. And press the Generate Declarative Directive button, you'll get a NPE in your sample:

      when {
        // ERROR TRANSLATING CONDITIONAL: java.lang.NullPointerException
      }
      

      Accidental find.

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            There's a PR up from a community member at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/277 - just waiting for it to have a test.

            Show
            abayer Andrew Bayer added a comment - There's a PR up from a community member at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/277 - just waiting for it to have a test.
            Hide
            abayer Andrew Bayer added a comment -

            This'll be in 1.3.2

            Show
            abayer Andrew Bayer added a comment - This'll be in 1.3.2

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                kshultz Karl Shultz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: