From 4a49d8d14fa8a3e037364eb231f25c2e8bce0fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Thu, 4 Feb 2016 11:23:12 +0000 Subject: [PATCH] Don't do remote checks on NULL files Calling _gtk_file_consider_as_remote() with a NULL argument results in warnings being thrown. Note that query->priv->location being NULL is a state that does not seem to be invalid by itself. This could happen if you do search-as-you-type in a filechooser, which has a filter that does not match anything *and* the current "place" selected is "Recent". https://bugzilla.gnome.org/show_bug.cgi?id=761552 --- gtk/gtkfilechooserwidget.c | 3 ++- gtk/gtksearchenginesimple.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index d1a2ed8b36..c77a8b7b96 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -7340,7 +7340,8 @@ search_start_query (GtkFileChooserWidget *impl, _gtk_search_engine_start (priv->search_engine); - if (_gtk_file_consider_as_remote (gtk_query_get_location (priv->search_query))) + if (gtk_query_get_location (priv->search_query) && + _gtk_file_consider_as_remote (gtk_query_get_location (priv->search_query))) gtk_widget_show (priv->remote_warning_bar); } diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c index b80af31b1f..6daf2f8631 100644 --- a/gtk/gtksearchenginesimple.c +++ b/gtk/gtksearchenginesimple.c @@ -92,7 +92,8 @@ static void queue_if_local (SearchThreadData *data, GFile *file) { - if (!_gtk_file_consider_as_remote (file) && + if (file && + !_gtk_file_consider_as_remote (file) && !g_file_has_uri_scheme (file, "recent")) g_queue_push_tail (data->directories, g_object_ref (file)); }