Don't fail when generating first id
This commit is contained in:
parent
9c683792be
commit
8463e3dec0
1 changed files with 5 additions and 3 deletions
|
@ -128,9 +128,11 @@
|
||||||
|
|
||||||
(define (next-id)
|
(define (next-id)
|
||||||
"Look through all known todo items and get the next id."
|
"Look through all known todo items and get the next id."
|
||||||
|
(if (> (length todo-list) 0)
|
||||||
(1+ (apply max (map (lambda (elm)
|
(1+ (apply max (map (lambda (elm)
|
||||||
(get-field-value id elm 0))
|
(get-field-value id elm 0))
|
||||||
todo-list))))
|
todo-list)))
|
||||||
|
1))
|
||||||
|
|
||||||
(define (add args)
|
(define (add args)
|
||||||
"Add item to the list."
|
"Add item to the list."
|
||||||
|
|
Loading…
Reference in a new issue