1
0
Fork 0
mirror of https://github.com/Luzifer/worktime.git synced 2024-10-18 08:04:22 +00:00

Ensure times slice is available

This commit is contained in:
Knut Ahlers 2016-09-24 15:35:37 +02:00
parent aac25b8d51
commit 6f09ab93c2
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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
}