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:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user