diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 0dad05902270707b9c3f721873e1534547e7f117..e81ba12758e21a52b0f4204fb57184e95e6e807d 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -91,7 +91,9 @@ class Trashbin {
 			
 			// if location no longer exists, restore file in the root directory
 			$location = $result[0]['location'];
-			if ( $result[0]['location'] != '/' && !$view->is_dir('files'.$result[0]['location']) ) {
+			if ( $result[0]['location'] != '/' && 
+				 (!$view->is_dir('files'.$result[0]['location']) ||
+				 !$view->is_writable('files'.$result[0]['location'])) ) {
 				$location = '';
 			}
 		} else {