aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-04-16 22:06:09 +0200
committerGitHub <noreply@github.com>2020-04-16 22:06:09 +0200
commit4242150173124615ebad827dc4763a70d4952f1a (patch)
tree26200c325b2b019de0e3faa7ace7a8d31e74fdb0
parentd3fc94a650f863245052c11b5fe346786fd04dcb (diff)
parent8a81b9fec76e355f404d00ee250db49bee593db3 (diff)
downloadgit-bug-4242150173124615ebad827dc4763a70d4952f1a.tar.gz
Merge pull request #378 from vojta001/master
termui: fix a crash when trying to open a bug when there are none
-rw-r--r--termui/bug_table.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/termui/bug_table.go b/termui/bug_table.go
index 80d5ebcb..2913ac80 100644
--- a/termui/bug_table.go
+++ b/termui/bug_table.go
@@ -437,6 +437,10 @@ func (bt *bugTable) newBug(g *gocui.Gui, v *gocui.View) error {
}
func (bt *bugTable) openBug(g *gocui.Gui, v *gocui.View) error {
+ if len(bt.excerpts) == 0 {
+ // There are no open bugs, just do nothing
+ return nil
+ }
id := bt.excerpts[bt.selectCursor].Id
b, err := bt.repo.ResolveBug(id)
if err != nil {