From 6f09ab93c2758e70005dc36bfcc33462af1a904c Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 24 Sep 2016 15:35:37 +0200 Subject: [PATCH] Ensure times slice is available --- schema/schema.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/schema.go b/schema/schema.go index 4e45fbd..5949fd1 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -117,7 +117,7 @@ func LoadDay(db *couch.Client, date time.Time, mayCreate bool) (*Day, error) { doc := &Day{} if err := db.Get(id, doc); err != nil { if strings.Contains(err.Error(), "not_found") && mayCreate { - doc = &Day{DayID: id} + doc = &Day{DayID: id, Times: []*Time{}} } else { return nil, err }