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

GHCommitPointer throws NPE on null repository #2035

Open
rnveach opened this issue Feb 17, 2025 · 2 comments
Open

GHCommitPointer throws NPE on null repository #2035

rnveach opened this issue Feb 17, 2025 · 2 comments
Labels

Comments

@rnveach
Copy link
Contributor

rnveach commented Feb 17, 2025

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.

@rnveach
Copy link
Contributor Author

rnveach commented Feb 17, 2025

@bitwiseman Can you explain how repo is normally populated? I assume there is reflection going on here as there is no setter or assignment.

@bitwiseman
Copy link
Member

@rnveach
https://github.com/FasterXML/jackson populating from JSON to objects.

@bitwiseman bitwiseman added the bug label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants