summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-01-13 23:32:20 +0200
committerAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-01-24 14:30:19 +0200
commit82a2d53e98758623cc2ebca176391d2d1f639e91 (patch)
treeff33135fbaf566a5790bad5b5b4c8acd6f681bbc
parent1d0d8e7c9c369ceb4b04801d3e500447081513ce (diff)
downloadnautilus-82a2d53e98758623cc2ebca176391d2d1f639e91.tar.gz
files-view: fix crash on enter in search
Pressing enter with no selection while in search makes Nautilus crash. The problem is that Nautilus will try to access the first element of a list that is NULL. To avoid this, make sure that the list is not NULL. https://bugzilla.gnome.org/show_bug.cgi?id=777214
-rw-r--r--src/nautilus-files-view.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 8498cb3dd..6bcdb0df8 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1136,6 +1136,11 @@ nautilus_files_view_activate_files (NautilusFilesView *view,
GList *files_to_activate;
char *path;
+ if (files == NULL)
+ {
+ return;
+ }
+
files_to_extract = nautilus_file_list_filter (files,
&files_to_activate,
(NautilusFileFilterFunc) nautilus_mime_file_extracts,