views: protect against invalid drop

If the user tries to drop a e.g. file, GNOME Calendar crashes
immediately.

While the desired behavior would be checking if that's an ics file,
lets just not crash for now.

https://bugzilla.gnome.org/show_bug.cgi?id=771680
This commit is contained in:
Georges Basile Stavracas Neto
2016-09-27 22:41:17 -03:00
parent 10391ae6a9
commit 81873994da
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -879,6 +879,10 @@ gcal_month_view_drag_drop (GtkWidget *widget,
cell = get_dnd_cell (widget, x, y);
event_widget = gtk_drag_get_source_widget (context);
if (!GCAL_IS_EVENT_WIDGET (event_widget))
return FALSE;
event = gcal_event_widget_get_event (GCAL_EVENT_WIDGET (event_widget));
/* Move the event's date */
+3
View File
@@ -1342,6 +1342,9 @@ navigator_drag_drop_cb (GcalYearView *self,
if (calculate_day_month_for_coord (self, x, y, &day, &month, &is_title))
{
if (!GCAL_IS_EVENT_WIDGET (gtk_drag_get_source_widget (context)))
return FALSE;
if (!is_title)
{
GcalEventWidget *event_widget;