Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException at "BuildCause.getUpstreamBuild()" #172

Closed
pavelbely opened this issue Jul 20, 2016 · 1 comment
Closed

NullPointerException at "BuildCause.getUpstreamBuild()" #172

pavelbely opened this issue Jul 20, 2016 · 1 comment
Milestone

Comments

@pavelbely
Copy link

pavelbely commented Jul 20, 2016

This is issue #125 revisited

public class BuildCause {
   ...
    private Integer upstreamBuild;
   ...
    public BuildCause() {
        this.upstreamBuild = new Integer(0);
    }

    public int getUpstreamBuild() {
        return upstreamBuild;
    }

    public void setUpstreamBuild(Integer upstreamBuild) {
        this.upstreamBuild = upstreamBuild;
    }

NullPointerException is thrown when getUpstreamBuild() is called.
Probably setting it to default value in the constructor has no effect, as it is being rewritten afterwards.

We use jenkins-client ver. 0.3.5 and Jenkins ver. 1.639

@khmarbaise
Copy link
Member

khmarbaise commented Jul 24, 2016

First thanks for your check. I have found the real issue which is caused by the BuildWithDetails class which initialised in its method getCauses() the BuildCause but simply overwrote the initialised values which could cause a NPE. I have improved the code in getCauses() which now handles it correct (I hope so)..

@khmarbaise khmarbaise added this to the Release 0.3.6 milestone Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants