diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 956a8774150a9efde35fe59f5932c4a9dec76605..2e824a4a9dfa151a3b3e483f62a8ad90c240e1ac 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -58,10 +58,8 @@ class Api {
 			return new \OC_OCS_Result(null, 404, 'could not get shares');
 		} else {
 			foreach ($shares as &$share) {
-				// file_target might not be set if the target user hasn't mounted
-				// the filesystem yet
-				if ($share['item_type'] === 'file' && isset($share['file_target'])) {
-					$share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']);
+				if ($share['item_type'] === 'file' && isset($share['path'])) {
+					$share['mimetype'] = \OC_Helper::getFileNameMimeType($share['path']);
 				}
 				$newShares[] = $share;
 			}