From ff9c663c8c647a765c0e29e6cb2b50722fee0cdd Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 7 Oct 2017 11:20:23 -0300 Subject: [PATCH] month-view: only update selection if there's a start date We can potentially not have an end date set, but there's always a start date. If there isn't, it means the user clicked from outside of month view, or at an invalid cell, in which cases we shouldn't display the quick add popover anyway. --- src/views/gcal-month-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/gcal-month-view.c b/src/views/gcal-month-view.c index 8c3027e0..8a489892 100644 --- a/src/views/gcal-month-view.c +++ b/src/views/gcal-month-view.c @@ -232,7 +232,7 @@ emit_create_event (GcalMonthView *self) GCAL_ENTRY; - if (!self->end_mark_cell) + if (!self->start_mark_cell || !self->end_mark_cell) GCAL_RETURN (FALSE); should_clear_end = FALSE; @@ -534,7 +534,7 @@ update_month_cells (GcalMonthView *self) selection_start = self->start_mark_cell; selection_end = self->end_mark_cell; - if (selection_start || selection_end) + if (selection_start) { if (!selection_end) selection_end = selection_start;