diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-17 16:42:10 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-17 16:42:10 +0200 |
commit | c974cc022d3ecd2e7567e66bdce504fe8c51e922 (patch) | |
tree | ac18603b10b2fabe1e03fc1895215d3f99d81080 | |
parent | d959acc29dcbc467790ae87389f9569bb830c8c6 (diff) | |
download | git-bug-c974cc022d3ecd2e7567e66bdce504fe8c51e922.tar.gz |
termui: fix a crash when a bug is created with an empty message
-rw-r--r-- | termui/termui.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/termui/termui.go b/termui/termui.go index a2a1a835..9894dfb2 100644 --- a/termui/termui.go +++ b/termui/termui.go @@ -179,19 +179,22 @@ func newBugWithEditor(repo cache.RepoCacher) error { var b cache.BugCacher if err == input.ErrEmptyTitle { ui.msgPopup.Activate(msgPopupErrorTitle, "Empty title, aborting.") + initGui(nil) + + return errTerminateMainloop } else { b, err = repo.NewBug(title, message) if err != nil { return err } - } - initGui(func(ui *termUI) error { - ui.showBug.SetBug(b) - return ui.activateWindow(ui.showBug) - }) + initGui(func(ui *termUI) error { + ui.showBug.SetBug(b) + return ui.activateWindow(ui.showBug) + }) - return errTerminateMainloop + return errTerminateMainloop + } } func addCommentWithEditor(bug cache.BugCacher) error { |