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

NPE generating change log for retrying-again #6

Closed
sleberknight opened this issue Sep 3, 2021 · 4 comments · Fixed by #7
Closed

NPE generating change log for retrying-again #6

sleberknight opened this issue Sep 3, 2021 · 4 comments · Fixed by #7
Assignees
Labels
bug Something isn't working

Comments

@sleberknight
Copy link
Member

Got the following trying to generate change log for retrying-again:

Finding commits between v0.7.0..v1.0.0 in dir: /home/users/scottl/Projects/kiwiproject/retrying-again
Loading all commits between v0.7.0 and v1.0.0
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Collecting ticket ids from 5 commits.
Fetching ticket info from https://api.github.com/kiwiproject/retrying-again based on 3 ids [89, 88, 87]
Querying Github API for 3 tickets.
Request url: https://api.github.com/repos/kiwiproject/retrying-again/issues?page=1&per_page=100&state=closed&filter=all&direction=desc
Github API rate info => Remaining : 4996, Limit : 5000, Reset at: 2021-09-03T18:54:26
Next page 'Link' from Github: null
Exception in thread "main" java.lang.RuntimeException: Problems fetching 3 tickets from Github
	at org.kiwiproject.changelog.GithubTicketFetcher.fetchTickets(GithubTicketFetcher.kt:32)
	at org.kiwiproject.changelog.GenerateChangelog.generate(GenerateChangelog.kt:27)
	at MainKt.main(main.kt:25)
Caused by: java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String
	at org.kiwiproject.changelog.GithubTicketFetcher.isIssueOrLonePr(GithubTicketFetcher.kt:75)
	at org.kiwiproject.changelog.GithubTicketFetcher.extractImprovements(GithubTicketFetcher.kt:65)
	at org.kiwiproject.changelog.GithubTicketFetcher.fetchTickets(GithubTicketFetcher.kt:29)
	... 2 more
@sleberknight
Copy link
Member Author

So this line:

 return issue["pull_request"] == null || parseTickets(issue["body"] as String).isEmpty() || userIsAlwaysIncluded(issue)

is where the NPE occurs. And issue["body"] returns null which causes the NPE because of the as String part !!!

@sleberknight sleberknight added the bug Something isn't working label Sep 3, 2021
@sleberknight
Copy link
Member Author

The specific issue where this happens is: kiwiproject/retrying-again#89

@chrisrohr
Copy link
Collaborator

Ok, send a PR please

@sleberknight
Copy link
Member Author

Any idea how to fix that in Kotlin?

sleberknight added a commit that referenced this issue Sep 3, 2021
* Modify isIssueOrLonePr to handle situation when issue["body"] returns
  null. Really not sure why we've never seen this before, unless it's
  a change GitHub made recently

Fixes #6
@sleberknight sleberknight self-assigned this Sep 3, 2021
chrisrohr pushed a commit that referenced this issue Sep 3, 2021
* Handle case when issue body is null

* Modify isIssueOrLonePr to handle situation when issue["body"] returns
  null. Really not sure why we've never seen this before, unless it's
  a change GitHub made recently

Fixes #6

* Expand imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants