diff options
author | monsta <[email protected]> | 2015-09-17 11:36:03 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2015-09-17 11:36:03 +0300 |
commit | 0c1b46500bf0e42f1f9abe3f9152d7604f41cfed (patch) | |
tree | 07a53c01e5de639aae516c5877fb3c8f59c585b9 | |
parent | bc11ee765a8334020f02fd7802d6eb5802b80c33 (diff) | |
download | caja-0c1b46500bf0e42f1f9abe3f9152d7604f41cfed.tar.bz2 caja-0c1b46500bf0e42f1f9abe3f9152d7604f41cfed.tar.xz |
undostack: don't try restoring files w/o "trash::orig-path" attribute
fixes https://github.com/mate-desktop/caja/issues/361
-rw-r--r-- | libcaja-private/caja-undostack-manager.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index eff05a10..f989add3 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -1986,6 +1986,11 @@ retrieve_files_to_restore (GHashTable * trashed) while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) { /* Retrieve the original file uri */ const char *origpath = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_TRASH_ORIG_PATH); + if (origpath == NULL) { + g_warning ("The item cannot be restored from trash: could not determine original location"); + continue; + } + GFile *origfile = g_file_new_for_path (origpath); char *origuri = g_file_get_uri (origfile); g_object_unref (origfile); |