aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-17 16:42:10 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-17 16:42:10 +0200
commitc974cc022d3ecd2e7567e66bdce504fe8c51e922 (patch)
treeac18603b10b2fabe1e03fc1895215d3f99d81080
parentd959acc29dcbc467790ae87389f9569bb830c8c6 (diff)
downloadgit-bug-c974cc022d3ecd2e7567e66bdce504fe8c51e922.tar.gz
termui: fix a crash when a bug is created with an empty message
-rw-r--r--termui/termui.go15
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 {