You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull requests can have their forks deleted:
https://stackoverflow.com/questions/36071272/fix-unknown-repository-of-an-opened-pr-after-deleted-the-forkisaacs/github#168
This means the head.repo could be null, although this isn't documented
in the API doc for listing pull requests:
https://developer.github.com/v3/pulls/#list-pull-requests
This causes github-api to throw an exception:
java.util.NoSuchElementException: None.get
Here's how to recreate the bug with a JSON payload in a file.
import org.json4s.JArray
import org.json4s.jackson.JsonMethods.parse
import codecheck.github.models.PullRequest
val json = scala.io.Source.fromFile("data/prs.json").getLines.mkString
parse(json).asInstanceOf[JArray].arr.map(PullRequest(_)).map(_.head.repo.name)
0 commit comments