diff options
author | amine <hilalyamine@gmail.com> | 2019-11-05 21:03:16 +0100 |
---|---|---|
committer | amine <hilalyamine@gmail.com> | 2019-11-05 21:03:16 +0100 |
commit | 13f98d0cc47cde61aeff62f1656ec6b4b5922c1c (patch) | |
tree | 11881f3a281e062cc8582da8bbc548225c5c9c81 /bridge/github | |
parent | 163ea9c93306c387f84ff0b85c2d8fca4c01e449 (diff) | |
download | git-bug-13f98d0cc47cde61aeff62f1656ec6b4b5922c1c.tar.gz |
bridge/github: improve iterator NextTimelineItem function
Diffstat (limited to 'bridge/github')
-rw-r--r-- | bridge/github/iterator.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/github/iterator.go b/bridge/github/iterator.go index a97ed036..786f0fbf 100644 --- a/bridge/github/iterator.go +++ b/bridge/github/iterator.go @@ -214,6 +214,7 @@ func (i *iterator) NextTimelineItem() bool { return false } + // after NextIssue call it's good to check wether we have some timeline items or not if len(i.timeline.query.Repository.Issues.Nodes[0].Timeline.Edges) == 0 { return false } @@ -240,6 +241,11 @@ func (i *iterator) NextTimelineItem() bool { return false } + // (in case github returns something wierd) just for safety: better return a false than a panic + if len(i.timeline.query.Repository.Issues.Nodes[0].Timeline.Edges) == 0 { + return false + } + i.reverseTimelineEditNodes() i.timeline.index = 0 return true |