summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-30 12:35:04 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 12:35:04 +0200
commit7fac2b62e954b0f8a693516da1151c97efa2ee99 (patch)
treef638ba7e2f3554b7b1a31f628496c7d0740fd2ac /apps
parent5e4e7734467a00bd40e3a04d72a5f49f012ced40 (diff)
downloadnextcloud-server-7fac2b62e954b0f8a693516da1151c97efa2ee99.tar.gz
nextcloud-server-7fac2b62e954b0f8a693516da1151c97efa2ee99.zip
Fixed warning when file_target is not set
In some cases (like in the unit tests) "file_target" is not set yet whenever the target file system hasn't been mounted yet.
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/api.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index ff56c465b29..dc4e5cf6c49 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -58,7 +58,9 @@ class Api {
return new \OC_OCS_Result(null, 404, 'could not get shares');
} else {
foreach ($shares as &$share) {
- if ($share['item_type'] === 'file') {
+ // 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']);
}
$newShares[] = $share;