fix NoSuchElementException when no comments #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the following error when looking on a new pull requests with
no comments yet:
Sep 9, 2012 2:27:10 PM hudson.triggers.Trigger checkTriggers
WARNING: org.jenkinsci.plugins.ghprb.GhprbTrigger.run() failed for xxx
java.util.NoSuchElementException
at org.kohsuke.github.Requester$1.next(Requester.java:212)
at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:42)
at org.kohsuke.github.PagedIterator.nextPage(PagedIterator.java:57)
at org.kohsuke.github.PagedIterable.asList(PagedIterable.java:20)
at org.kohsuke.github.GHIssue.getComments(GHIssue.java:184)
at org.jenkinsci.plugins.ghprb.GhprbPullRequest.check(GhprbPullRequest.java:46)
at org.jenkinsci.plugins.ghprb.GhprbRepo.check(GhprbRepo.java:60)
at org.jenkinsci.plugins.ghprb.GhprbTrigger.run(GhprbTrigger.java:92)
at hudson.triggers.Trigger.checkTriggers(Trigger.java:259)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:207)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)