Skip to content

GHCommitPointer throws NPE on null repository #2035

@rnveach

Description

@rnveach

Describe the bug

I receive an NPE on GHCommitPointer#getCommit because getRepository() returns null.

I assume getRepository() should always be populated as I need a GHRepository to even get the initial PR/issue in the first place.

To Reproduce

While scanning https://github.com/checkstyle/checkstyle/pulls , I pick up PR 1.
I call GHPullRequest#getHead() and get the GHCommitPointer.
I call GHCommitPointer#getCommit() and receive an NPE.
getRepository() returns null.

Expected behavior

No NPE.

Additional context

GHPullRequest#getBase() doesn't seem to have this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions