Commit 041ccd7f authored by Matthias Clasen's avatar Matthias Clasen

GtkPlacesSidebar: Don't crash on dnd

gtk_get_current_event() can return NULL. Don't crash if it does.

https://bugzilla.gnome.org/show_bug.cgi?id=739150
parent e35d91d1
......@@ -1420,11 +1420,13 @@ static gboolean
clicked_eject_button (GtkPlacesSidebar *sidebar,
GtkTreePath **path)
{
GdkEvent *event = gtk_get_current_event ();
GdkEventButton *button_event = (GdkEventButton *) event;
GdkEvent *event;
if ((event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
over_eject_button (sidebar, button_event->x, button_event->y, path))
event = gtk_get_current_event ();
if (event &&
(event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
over_eject_button (sidebar, ((GdkEventButton *)event)->x, ((GdkEventButton *)event)->y, path))
return TRUE;
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment