aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/app.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-01-16 00:46:28 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-01-16 01:07:21 +0800
commit05b64e4315ba17960f5bb2119e79eec2476459b2 (patch)
treed88f50d6fc4bc8f8a917d1c7161bd5d11a544418 /todolist/app.go
parentc3c8817de6228557ba865465e3d639a104578587 (diff)
Bugfix: "todo a" no longer adds an empty todo
Diffstat (limited to 'todolist/app.go')
-rw-r--r--todolist/app.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/todolist/app.go b/todolist/app.go
index 44d97f5..7644d46 100644
--- a/todolist/app.go
+++ b/todolist/app.go
@@ -25,6 +25,10 @@ func (a *App) AddTodo(input string) {
a.Load()
parser := &Parser{}
todo := parser.ParseNewTodo(input)
+ if todo == nil {
+ fmt.Println("What to do?")
+ return
+ }
a.TodoList.Add(todo)
a.Save()