summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-09-17 11:36:03 +0300
committermonsta <[email protected]>2015-09-17 11:45:42 +0300
commitf8ed2af9510cb20f2ad8101aeaab5c6458ade0d7 (patch)
treed29ee5d5b175740f2cd906b75d82f7896657e551 /libcaja-private
parentb1e9a7fe429546105ffda8424cc5719a13e8a295 (diff)
downloadcaja-f8ed2af9510cb20f2ad8101aeaab5c6458ade0d7.tar.bz2
caja-f8ed2af9510cb20f2ad8101aeaab5c6458ade0d7.tar.xz
undostack: don't try restoring files w/o "trash::orig-path" attribute
fixes https://github.com/mate-desktop/caja/issues/361
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-undostack-manager.c5
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);