Skip to content

Commit 45dfd2a

Browse files
committed
fix nil dereference
1 parent 54753ac commit 45dfd2a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/core/core_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func (c *Core) updateFollowingChildren(old, new *Event) (*Event, error) {
277277
newEvent.Id = uuid.New() // assign new id
278278
newEvent.ParentId = uuid.Nil // not child anymore
279279

280-
if originalCount != 0 {
280+
if originalCount != 0 && newEvent.Repeat != nil {
281281
// shorten the repeat for the second half
282282
_, elapsed := firstOccurrenceAtOrAfter(old.From, parent)
283283
if elapsed <= 0 {

pkg/core/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Event struct {
2929
Calendar string `json:"calendar,omitzero"` // The name of the calendar the event belongs to.
3030
Tag string `json:"tag,omitzero"` // User-defined category or label.
3131
ParentId uuid.UUID `json:"parent_id,omitzero"` // Specific for child events. It is uuid.Nil if the event is basic or parent.
32-
Repeat *Repetition `json:"repeat,omitzero"` // nil if child
32+
Repeat *Repetition `json:"repeat,omitzero"`
3333
}
3434

3535
// Repetition defines the recurrence rules for a Parent event.

0 commit comments

Comments
 (0)