Skip to content

Consider Returning null from the "getTestReport()" of Build.java class for builds that Never run. #209

Description

@manojkumar405

For Builds that never ran the "client" object will be "null" and when we call getTestReport() results in NPE
the issue occurs when using the code as below:
final JenkinsServer server = new JenkinsServer(URI.create(url));
JobWithDetails job = server.getJob(jobName);
job.getLastBuild().getTestReport();

we can avoid that by additional check using job.getLastBuild() != Build.BUILD_HAS_NEVER_RUN to avoid it. but it is upto the developer.

Consider returning null or placeholder Indicator in TestReport.java similar to Build.BUILD_HAS_NEVER_RUN when the build has never ran.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions