summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2018-03-18 17:40:08 +0200
committerErnestas Kulik <ernestask@gnome.org>2018-03-19 08:42:25 +0200
commita5dc2cc501e436a7593c1d2b3adfdac2acbd20c8 (patch)
tree88714f2fdaa411275a833e1ef7cf5471e709aa09
parent5548a19921ea0a71ea3251aae2cd4ac42b5e72f2 (diff)
downloadnautilus-a5dc2cc501e436a7593c1d2b3adfdac2acbd20c8.tar.gz
query-editor: Return if location unset when creating query
Since the location of the query editor is nullable, we cannot rely on it having a value. An example of such situation is triggering a search while the window slot has no view set and, therefore, no location, which can happen when opening remote locations.
-rw-r--r--src/nautilus-query-editor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index 0041ff5b4..a2291a87a 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -391,6 +391,11 @@ create_query (NautilusQueryEditor *editor)
fts_enabled = nautilus_search_popover_get_fts_enabled (NAUTILUS_SEARCH_POPOVER (priv->popover));
+ if (priv->location == NULL)
+ {
+ return;
+ }
+
file = nautilus_file_get (priv->location);
query = nautilus_query_new ();