diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 4d21eae..8c1f60c 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -2143,6 +2143,9 @@ ewv_pass_gdkevent_to_etext (EWeekView *week_view, GdkEvent *gevent)
 		EWeekViewEventSpan *span;
 
 		event = &g_array_index (week_view->events, EWeekViewEvent, week_view->editing_event_num);
+    if (event->spans_index + week_view->editing_span_num >= week_view->spans->len) {
+      return FALSE;
+    }
 		span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + week_view->editing_span_num);
 
 		if (span->text_item && E_IS_TEXT (span->text_item)) {
