window-slot: Don’t show query editor with no view

Since the view can be null at the time the user is pressing keys, doing
anything with it may lead to a crash.
This commit is contained in:
Ernestas Kulik 2018-03-18 17:42:36 +02:00
parent a5dc2cc501
commit fddcda2d96

View file

@ -509,6 +509,10 @@ show_query_editor (NautilusWindowSlot *self)
priv = nautilus_window_slot_get_instance_private (self);
view = nautilus_window_slot_get_current_view (self);
if (view == NULL)
{
return;
}
if (nautilus_view_is_searching (view))
{
@ -2782,8 +2786,6 @@ nautilus_window_slot_dispose (GObject *object)
nautilus_window_slot_remove_extra_location_widgets (self);
nautilus_window_slot_set_active (self, FALSE);
if (priv->content_view)
{
gtk_widget_destroy (GTK_WIDGET (priv->content_view));