diff options
author | Corey Berla <corey@berla.me> | 2023-04-11 12:17:31 -0700 |
---|---|---|
committer | Corey Berla <corey@berla.me> | 2023-04-12 19:54:16 +0000 |
commit | 9dd4a7f87c422bf2043e8dca9d7e7f148c95fa80 (patch) | |
tree | bafd2e5a7667d05918e830d0a30c1274d55394cf /src/nautilus-files-view.c | |
parent | a417d86b74046d79079c47be880d3b9c744d46de (diff) | |
download | nautilus-9dd4a7f87c422bf2043e8dca9d7e7f148c95fa80.tar.gz |
files-view: Don't add non-existent files
Under certain circumstances (i.e. moving a file), we end up adding
a non-existent file. This causes selection problems because the
non-existent file is selected and then removed (causing another file
to be selected). I'm not sure where the root cause is (between
directory-async, directory notify, etc), but lets simply not add
a file that we know shouldn't be added.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2828
Diffstat (limited to 'src/nautilus-files-view.c')
-rw-r--r-- | src/nautilus-files-view.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index abc9a39b7..adce3f519 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -4341,6 +4341,11 @@ process_old_files (NautilusFilesView *view) for (GList *node = files_added; node != NULL; node = node->next) { pending = node->data; + if (nautilus_file_is_gone (pending->file)) + { + g_warning ("Attempted to add a non-existent file to the view."); + continue; + } pending_additions = g_list_prepend (pending_additions, pending->file); /* Acknowledge the files that were pending to be revealed */ if (g_hash_table_contains (priv->pending_reveal, pending->file)) |